Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authornhauge2008-09-24 03:25:55 +0000
committernhauge2008-09-24 03:25:55 +0000
commit4a1176558e26b7ddd5ebe67488ca03e9abf3bb95 (patch)
tree14718d7f61efc91af3d3473e9c71ad222233a829 /jpa
parent3a86aa898ad95e4e77dd94936271200cb173b7cb (diff)
downloadwebtools.dali-200809230002.tar.gz
webtools.dali-200809230002.tar.xz
webtools.dali-200809230002.zip
This commit was manufactured by cvs2svn to create tag 'v200809230002'.v200809230002
Diffstat (limited to 'jpa')
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/build.properties15
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties140
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml52
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html83
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties16
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html82
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html83
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties140
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml28
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.feature/build.properties15
-rw-r--r--jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.properties140
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.xml92
-rw-r--r--jpa/features/org.eclipse.jpt.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html83
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties16
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html82
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html83
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/build.properties10
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.xml44
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.properties140
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.xml35
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/license.html98
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF14
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties25
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF16
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/build.properties19
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/plugin.properties25
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java549
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java189
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java1075
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java340
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java307
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java421
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF9
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.html42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/build.properties115
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml44
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml88
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm57
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml422
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css21
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm11
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm82
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm101
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm200
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.pngbin11748 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.pngbin11473 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.pngbin4148 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/change_connection_profile.pngbin27031 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.pngbin12713 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.pngbin16438 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.pngbin23710 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.pngbin23711 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.pngbin21704 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.pngbin5647 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.pngbin6361 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.pngbin13762 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.pngbin6223 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.pngbin11615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.pngbin3359 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.pngbin4236 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.pngbin7823 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.pngbin7864 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.pngbin11725 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.pngbin19392 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.pngbin15081 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.pngbin14963 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.pngbin15145 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.pngbin332 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.pngbin700 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.pngbin477 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.pngbin321 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.pngbin461 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.pngbin311 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.pngbin316 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.pngbin682 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.pngbin681 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.pngbin325 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.pngbin270 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.pngbin303 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.pngbin373 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.pngbin26085 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.pngbin387 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.pngbin25449 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.pngbin667 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.pngbin615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.pngbin568 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.pngbin12520 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.pngbin14334 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.pngbin8746 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.pngbin2899 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.pngbin22916 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.pngbin9094 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.pngbin1750 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.pngbin20222 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.pngbin20446 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.pngbin20509 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.pngbin16378 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.pngbin9169 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.pngbin6361 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/index.xml544
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/legal.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties32
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml37
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm261
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm138
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm131
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm113
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm38
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm119
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm97
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm75
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm100
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm94
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm103
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm115
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm163
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm153
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm157
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm217
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm124
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm139
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm106
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm70
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm128
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm212
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm156
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm69
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm95
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm69
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm83
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm181
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm107
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm87
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm169
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm172
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm160
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm190
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm139
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm133
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm87
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/toc.xml131
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/META-INF/MANIFEST.MF13
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jarbin46465 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF14
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java1780
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java363
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java302
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath7
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore6
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF25
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties19
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml27
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java43
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java26
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF20
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/build.properties15
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/derby.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/mysql.properties26
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties27
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties27
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties27
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/postgresql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver.properties27
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sybase.properties27
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/plugin.properties25
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java924
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java416
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java345
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java350
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java441
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java78
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java349
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF13
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/build.properties18
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/test.xml40
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF23
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/build.properties4
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java36
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java589
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java569
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java780
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java318
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java78
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java641
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java341
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java1203
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java320
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java801
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java85
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java85
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java44
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java123
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java125
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java123
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java94
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java94
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore5
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF18
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java1680
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java243
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java81
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java633
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java289
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java3881
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java594
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java547
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java566
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java107
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java237
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java226
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java101
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java142
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java1641
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java226
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java293
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java271
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java142
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java126
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java132
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java408
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java350
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java331
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java127
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java299
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java196
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java140
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java205
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java118
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java203
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java71
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java111
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java229
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java321
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java210
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java1721
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java455
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java744
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java195
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java146
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java515
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java410
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java250
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java369
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java237
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java236
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java416
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java849
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java153
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java256
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java294
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java288
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java187
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java242
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java243
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java333
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java304
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java475
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java274
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java316
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java45
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java327
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java154
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java201
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java411
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java329
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java94
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java198
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java319
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java186
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java355
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java158
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java169
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java383
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java277
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java136
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java315
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java113
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java393
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java160
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java257
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java318
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java372
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java200
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java231
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java259
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java343
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java646
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java733
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java817
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java426
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java528
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java29
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/test.xml40
582 files changed, 0 insertions, 76756 deletions
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore b/jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
deleted file mode 100644
index 93f19b18a8..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties
deleted file mode 100644
index 6f0fd807a2..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools - EclipseLink Support (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API Tools - EclipseLink Support (Optional)
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-08 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml b/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml
deleted file mode 100644
index b3626a2278..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.eclipselink.feature"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Dali Java Persistence API Tools (JPA) Updates" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.jpt.feature" version="2.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.core.ddlgen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/license.html
deleted file mode 100644
index fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 50c0a9ef9c..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Java Persistence API Tools - EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index d0d5f1c727..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Java Persistence API Tools - EclipseLink Support
-providerName = Eclipse.org
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 53abe6605b..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- epl-v10.html,\
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties,\
- license.html
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 9566406636..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools - EclipseLink Support (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2008 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a489ad..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 50c0a9ef9c..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Java Persistence API Tools - EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index d0d5f1c727..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Java Persistence API Tools - EclipseLink Support
-providerName = Eclipse.org
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt_sdk.feature_1.0.1.*
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
deleted file mode 100644
index 15f9157901..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index b479ccbeeb..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.eclipselink.feature.source=org.eclipse.jpt.eclipselink.feature
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index e8d47d70af..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools - EclipseLink Support SDK (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-08 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 58f025eff3..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.eclipselink_sdk.feature"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html
deleted file mode 100644
index fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/features/org.eclipse.jpt.feature/.cvsignore b/jpa/features/org.eclipse.jpt.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.feature/.project b/jpa/features/org.eclipse.jpt.feature/.project
deleted file mode 100644
index c8eb2f0481..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.feature/build.properties b/jpa/features/org.eclipse.jpt.feature/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.feature/feature.properties b/jpa/features/org.eclipse.jpt.feature/feature.properties
deleted file mode 100644
index a2b39f3024..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-07 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.feature/feature.xml b/jpa/features/org.eclipse.jpt.feature/feature.xml
deleted file mode 100644
index a7cf3d2d3b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.feature"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Dali Java Persistence API Tools (JPA) Updates" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.platform" version="3.4.0"/>
- <import feature="org.eclipse.gef" version="3.4.0"/>
- <import feature="org.eclipse.jdt" version="3.4.0"/>
- <import feature="org.eclipse.xsd" version="2.4.0"/>
- <import feature="org.eclipse.emf.codegen" version="2.4.0"/>
- <import feature="org.eclipse.emf.ecore" version="2.4.0"/>
- <import feature="org.eclipse.jst.web_core.feature" version="3.0.0"/>
- <import feature="org.eclipse.jst.enterprise_core.feature" version="3.0.0"/>
- <import feature="org.eclipse.jst.enterprise_ui.feature" version="3.0.0"/>
- <import feature="org.eclipse.datatools.modelbase.feature" version="1.6.0"/>
- <import feature="org.eclipse.datatools.enablement.feature" version="1.6.0"/>
- <import feature="org.eclipse.datatools.sqldevtools.feature" version="1.6.0"/>
- <import feature="org.eclipse.datatools.connectivity.feature" version="1.6.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.utility"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.db"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.db.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.feature/license.html b/jpa/features/org.eclipse.jpt.feature/license.html
deleted file mode 100644
index fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 15417ff15a..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence API (JPA) Tools Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index f948547000..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence API (JPA) Tools
-providerName = Eclipse.org
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index f60dad3f94..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- epl-v10.html,\
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties,\
- license.html
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 267f534af6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence API (JPA) Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 2008 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a489ad..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 15417ff15a..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence API (JPA) Tools Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index f948547000..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence API (JPA) Tools
-providerName = Eclipse.org
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore b/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.project b/jpa/features/org.eclipse.jpt.tests.feature/.project
deleted file mode 100644
index 91760f21b4..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.tests.feature/build.properties
deleted file mode 100644
index d6a4dce096..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
-src.includes = license.html,\
- feature.xml,\
- epl-v10.html,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.tests.feature/feature.properties
deleted file mode 100644
index 33ec536d55..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
deleted file mode 100644
index a34a08d462..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.tests.feature"
- label="Dali Java Persistence API Tools (JPA) JUnit Tests"
- version="2.1.0.qualifier"
- provider-name="Eclipse.org">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.jpt.utility.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.core.tests.extension.resource"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/license.html b/jpa/features/org.eclipse.jpt.tests.feature/license.html
deleted file mode 100644
index 56445985d9..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt_sdk.feature_1.0.1.*
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.project b/jpa/features/org.eclipse.jpt_sdk.feature/.project
deleted file mode 100644
index 33da750336..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt_sdk.feature/build.properties
deleted file mode 100644
index 2d7ab8d203..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.feature.source=org.eclipse.jpt.feature
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html b/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
deleted file mode 100644
index a14204ac5e..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools Plug-in SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-07 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
deleted file mode 100644
index 0e36c7c6ce..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt_sdk.feature"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.feature.source"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.doc.isv"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/license.html b/jpa/features/org.eclipse.jpt_sdk.feature/license.html
deleted file mode 100644
index fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath b/jpa/plugins/org.eclipse.jpt.db.ui/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.project b/jpa/plugins/org.eclipse.jpt.db.ui/.project
deleted file mode 100644
index 88ea5da610..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8fa7db1fac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:22 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 842c286bb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:42 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index f51bab64a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.db.ui
-Bundle-Version: 1.1.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.db.ui.internal; x-friends:="org.eclipse.jpt.ui"
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.datatools.connectivity.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/about.html b/jpa/plugins/org.eclipse.jpt.db.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/build.properties b/jpa/plugins/org.eclipse.jpt.db.ui/build.properties
deleted file mode 100644
index 0d56981f21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/component.xml b/jpa/plugins/org.eclipse.jpt.db.ui/component.xml
deleted file mode 100644
index bf648aaa4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.db.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.db.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties
deleted file mode 100644
index 2b0e5835b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence API Tools - DB UI
-providerName = Eclipse.org
-
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java b/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java
deleted file mode 100644
index ae67ad1cf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.db.ui.internal;
-
-import org.eclipse.datatools.connectivity.ICategory;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.internal.ConnectionProfileManager;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.CPWizardNode;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.NewCPWizard;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.ProfileWizardProvider;
-import org.eclipse.datatools.connectivity.ui.wizards.IProfileWizardProvider;
-import org.eclipse.datatools.connectivity.ui.wizards.IWizardCategoryProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * DTP UI tools
- */
-public class DTPUiTools {
-
-
- /**
- * Launch the DTP New Connection Profile wizard to create a new database connection profile.
- *
- * Returns the name of the added profile, or null if the wizard was cancelled.
- * The name can be used to build a Dali connection profile from
- * JptDbPlugin.getConnectionProfileFactory().buildConnectionProfile(String).
- */
- public static String createNewConnectionProfile() {
- // Filter datasource category
- NewCPWizard wizard = new NewCPWizard(new LocalViewerFilter(), null);
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.setBlockOnOpen(true);
-
- LocalProfileListener listener = new LocalProfileListener();
- ProfileManager.getInstance().addProfileListener(listener);
-
- String newCPName = null;
- if (wizardDialog.open() == Window.OK) {
- // assume the last added profile is the one we want
- newCPName = listener.addedProfile.getName();
- }
- ProfileManager.getInstance().removeProfileListener(listener);
-
- return newCPName;
- }
-
-
- // ********** DTP profile listener **********
-
- /**
- * This listener simply holds on to the most recently added connection
- * profile.
- */
- static class LocalProfileListener implements IProfileListener {
- IConnectionProfile addedProfile;
-
- public void profileAdded(IConnectionProfile profile) {
- this.addedProfile = profile;
- }
-
- public void profileChanged(IConnectionProfile profile) {
- // do nothing
- }
-
- public void profileDeleted(IConnectionProfile profile) {
- // do nothing
- }
- }
-
-
- // ********** viewer filter **********
-
- static class LocalViewerFilter extends ViewerFilter {
-
- private static final String DATABASE_CATEGORY_ID = "org.eclipse.datatools.connectivity.db.category"; //$NON-NLS-1$
-
- LocalViewerFilter() {
- super();
- }
-
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- CPWizardNode wizardNode = (CPWizardNode) element;
- IProfileWizardProvider wizardProvider = wizardNode.getProvider();
- if (wizardProvider instanceof IWizardCategoryProvider) {
- return false;
- }
- ICategory category = ConnectionProfileManager.getInstance().getProvider(
- ((ProfileWizardProvider) wizardProvider).getProfile()).getCategory();
-
- // Only display wizards belong to database category
- while (category != null) {
- if (category.getId().equals(DATABASE_CATEGORY_ID)) {
- return true;
- }
- category = category.getParent();
- }
- return false;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/.classpath b/jpa/plugins/org.eclipse.jpt.db/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.db/.cvsignore b/jpa/plugins/org.eclipse.jpt.db/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/.project b/jpa/plugins/org.eclipse.jpt.db/.project
deleted file mode 100644
index 5675a48e3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 84ebb5c739..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:02 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 929d54536d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:18 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF
deleted file mode 100644
index 17e145857a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.db
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.db.JptDbPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)"
-Export-Package: org.eclipse.jpt.db,
- org.eclipse.jpt.db.internal;x-internal:=true
diff --git a/jpa/plugins/org.eclipse.jpt.db/about.html b/jpa/plugins/org.eclipse.jpt.db/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.db/build.properties b/jpa/plugins/org.eclipse.jpt.db/build.properties
deleted file mode 100644
index 974eadac6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.db/component.xml b/jpa/plugins/org.eclipse.jpt.db/component.xml
deleted file mode 100644
index 644c396149..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.db"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.db" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/plugin.properties b/jpa/plugins/org.eclipse.jpt.db/plugin.properties
deleted file mode 100644
index e87a2d3972..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence API Tools - DB
-providerName = Eclipse.org
-
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java
deleted file mode 100644
index 5c6da7058d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-/**
- * Database catalog
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Catalog
- extends SchemaContainer, Comparable<Catalog>
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java
deleted file mode 100644
index e631a6da75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import org.eclipse.jpt.utility.JavaType;
-
-/**
- * Database column
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Column
- extends DatabaseObject, Comparable<Column>
-{
- /**
- * Return the column's table.
- */
- Table getTable();
-
- /**
- * Return whether the column is part of it's table's primary key.
- */
- boolean isPrimaryKeyColumn();
-
- /**
- * Return whether the column is part of one of it's table's foreign keys.
- */
- boolean isForeignKeyColumn();
-
- /**
- * Return the name of the column's datatype.
- */
- String getDataTypeName();
-
- /**
- * Return whether the column's datatype is a LOB type
- * (i.e. BLOB, CLOB, or NCLOB).
- */
- boolean dataTypeIsLOB();
-
-
- // ********** Java type **********
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type.
- */
- String getJavaTypeDeclaration();
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type.
- */
- JavaType getJavaType();
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- String getPrimaryKeyJavaTypeDeclaration();
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- JavaType getPrimaryKeyJavaType();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java
deleted file mode 100644
index 972848965c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-
-/**
- * An empty implementation of ConnectionListener.
- *
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ConnectionAdapter implements ConnectionListener {
-
- public void aboutToClose(ConnectionProfile profile) {
- // do nothing
- }
-
- public void closed(ConnectionProfile profile) {
- // do nothing
- }
-
- public void databaseChanged(ConnectionProfile profile, Database database) {
- // do nothing
- }
-
- public void modified(ConnectionProfile profile) {
- // do nothing
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- return true;
- }
-
- public void opened(ConnectionProfile profile) {
- // do nothing
- }
-
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- // do nothing
- }
-
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- // do nothing
- }
-
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- // do nothing
- }
-
- public void tableChanged(ConnectionProfile profile, Table table) {
- // do nothing
- }
-
- public void columnChanged(ConnectionProfile profile, Column column) {
- // do nothing
- }
-
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java
deleted file mode 100644
index 879ba1bedd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-
-/**
- * A ConnectionListener is notified of any changes to a connection.
- *
- * @see org.eclipse.datatools.connectivity.IManagedConnectionListener
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionListener {
-
- public void opened(ConnectionProfile profile);
- public void modified(ConnectionProfile profile);
- public boolean okToClose(ConnectionProfile profile);
- public void aboutToClose(ConnectionProfile profile);
- public void closed(ConnectionProfile profile);
-
- public void databaseChanged(ConnectionProfile profile, Database database);
- public void catalogChanged(ConnectionProfile profile, Catalog catalog);
- public void schemaChanged(ConnectionProfile profile, Schema schema);
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence);
- public void tableChanged(ConnectionProfile profile, Table table);
- public void columnChanged(ConnectionProfile profile, Column column);
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java
deleted file mode 100644
index 6dd625a783..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-
-/**
- * Database connection profile
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface ConnectionProfile
- extends DatabaseObject, Comparable<ConnectionProfile>
-{
-
- // ********** properties **********
-
- /**
- * Return the connection profile's database.
- * Return null if the connection profile is inactive.
- */
- Database getDatabase();
-
- /**
- * Return ID of the provider managing the DTP profile.
- */
- String getProviderID();
-
- /**
- * Return the connection profile's static ID.
- */
- String getInstanceID();
-
- /**
- * Return the default database name.
- */
- String getDatabaseName();
-
- /**
- * Return the database product name.
- */
- String getDatabaseProduct();
-
- /**
- * Return the database vendor.
- */
- String getDatabaseVendor();
-
- /**
- * Return the database version.
- */
- String getDatabaseVersion();
-
- /**
- * Return the driver class name.
- */
- String getDriverClassName();
-
- /**
- * Return the default connection URL.
- */
- String getURL();
-
- /**
- * Return the default user name.
- */
- String getUserName();
-
- /**
- * Return the default user password.
- */
- String getUserPassword();
-
- /**
- * Return the driver definition ID.
- */
- String getDriverDefinitionID();
-
- /**
- * Return the jar list for the driver instance as a
- * comma-delimited string.
- */
- String getDriverJarList();
-
- /**
- * Return the name of the Driver instance
- */
- String getDriverName();
-
- // ********** connection **********
-
- /**
- * Return whether the profile is either connected to a live database
- * session or working off-line (i.e. it has access to meta-data).
- * @see isConnected()
- * @see isWorkingOffline()
- */
- boolean isActive();
-
- /**
- * Return whether the profile is neither connected to a live database
- * session nor working off-line (i.e. it has access to meta-data).
- * @see isActive()
- */
- boolean isInactive();
-
- /**
- * Return whether the profile is connected to a live database session
- * (i.e. the meta-data comes from the database), as opposed to working
- * off-line.
- * @see #isActive()
- */
- boolean isConnected();
-
- /**
- * Return whether the profile is not connected to a live database session
- * (i.e. the meta-data comes from the database), as opposed to working
- * off-line.
- * @see #isConnected()
- */
- boolean isDisconnected();
-
- /**
- * Connect to the database.
- * @see #disconnect()
- */
- void connect();
-
- /**
- * Disconnect from the database.
- * @see #connect()
- */
- void disconnect();
-
-
- // ********** off-line support **********
-
- /**
- * Return whether the profile is working off-line (i.e. the meta-data
- * comes from a local cache), as opposed to connected to a live
- * database session.
- * @see #isActive()
- */
- boolean isWorkingOffline();
-
- /**
- * Return whether the connection factories associated with the
- * connection profile's provider support working offline.
- */
- boolean supportsWorkOfflineMode();
-
- /**
- * Save the state of the connection profile for working in an offline mode.
- * If the connection profile does not support working in an offline mode, no
- * exception is thrown and the method will return immediately.
- */
- IStatus saveWorkOfflineData();
-
- /**
- * Return whether the connection profile supports working offline and data
- * has been saved for working offline.
- */
- boolean canWorkOffline();
-
- /**
- * Begin working off-line.
- */
- IStatus workOffline();
-
-
- // ********** listeners **********
-
- /**
- * Add the specified connection listener to the connection profile.
- */
- void addConnectionListener(ConnectionListener listener);
-
- /**
- * Remove the specified connection listener from the connection profile.
- */
- void removeConnectionListener(ConnectionListener listener);
-
-
- // ********** constants **********
-
- String CONNECTION_PROFILE_TYPE = "org.eclipse.datatools.connectivity.db.generic.connectionProfile"; //$NON-NLS-1$
- String DRIVER_DEFINITION_PROP_ID = "org.eclipse.datatools.connectivity.driverDefinitionID"; //$NON-NLS-1$
- String DRIVER_DEFINITION_TYPE_PROP_ID = "org.eclipse.datatools.connectivity.drivers.defnType"; //$NON-NLS-1$
- String DRIVER_JAR_LIST_PROP_ID = "jarList"; //$NON-NLS-1$
- String DATABASE_SAVE_PWD_PROP_ID = IJDBCDriverDefinitionConstants.PROP_PREFIX + "savePWD"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java
deleted file mode 100644
index 648daa5bf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-/**
- * An empty implementation of ProfileListener.
- *
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ConnectionProfileAdapter implements ConnectionProfileListener {
-
- public void connectionProfileAdded(String name) {
- // do nothing
- }
-
- public void connectionProfileRemoved(String name) {
- // do nothing
- }
-
- public void connectionProfileRenamed(String oldName, String newName) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java
deleted file mode 100644
index e44773953a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-/**
- * Database connection profile factory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface ConnectionProfileFactory {
-
- /**
- * Return the names of the DTP connection profiles the factory can wrap with
- * new connection profiles.
- */
- Iterator<String> connectionProfileNames();
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return null if there is no DTP connection profile with the specified
- * name.
- * Use the specified database finder to allow clients to control how
- * database objects are found based on their names.
- */
- ConnectionProfile buildConnectionProfile(String name, DatabaseFinder finder);
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return null if there is no DTP connection profile with the specified
- * name.
- * Clients should use this method when a JPA platform is unavailable
- * (e.g. during project creation). The returned connection profile will
- * not be able to search for database objects by any names other than
- * those supplied by the factory (i.e. lookups cannot be performed with
- * "identifiers").
- */
- ConnectionProfile buildConnectionProfile(String name);
-
- /**
- * Add a listener that will be notified of changes to the DTP
- * connection profiles.
- */
- void addConnectionProfileListener(ConnectionProfileListener listener);
-
- /**
- * Remove the specified listener.
- */
- void removeConnectionProfileListener(ConnectionProfileListener listener);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java
deleted file mode 100644
index 66844b1380..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-/**
- * A ProfileListener is notified of any changes to the DTP connection profiles.
- *
- * @see org.eclipse.datatools.connectivity.IProfileListener
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfileListener {
-
- /**
- * The specified profile has been added.
- */
- public void connectionProfileAdded(String name);
-
- /**
- * The specified profile has been removed.
- */
- public void connectionProfileRemoved(String name);
-
- /**
- * The specified profile has been renamed.
- */
- public void connectionProfileRenamed(String oldName, String newName);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java
deleted file mode 100644
index c101d40f59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-/**
- * Database
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Database
- extends SchemaContainer, Comparable<Database>
-{
-
- // ********** properties **********
-
- /**
- * Return the name of the database's vendor.
- */
- String getVendorName();
-
- /**
- * Return the database's version.
- */
- String getVersion();
-
-
- // ********** catalogs **********
-
- /**
- * Return whether the database supports catalogs.
- */
- boolean supportsCatalogs();
-
- /**
- * Return the database's catalogs.
- * @see #supportsCatalogs()
- */
- Iterator<Catalog> catalogs();
-
- /**
- * Return the number of catalogs the database contains.
- * @see #supportsCatalogs()
- */
- int catalogsSize();
-
- /**
- * Return the catalog with specified name. The name must be an exact match
- * of the catalog's name.
- * @see #supportsCatalogs()
- * @see #getCatalogForIdentifier(String)
- */
- Catalog getCatalogNamed(String name);
-
- /**
- * Return the database's catalog identifiers, sorted by name.
- */
- Iterator<String> sortedCatalogIdentifiers();
-
- /**
- * Return the catalog for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #supportsCatalogs()
- * @see #getCatalogNamed(String)
- */
- Catalog getCatalogForIdentifier(String identifier);
-
- /**
- * Return the database's "default" catalog.
- * Return null if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- Catalog getDefaultCatalog();
-
-
- // ********** utility methods **********
-
- /**
- * Select and return from the specified list of database objects the
- * database object identified by the specified identifier.
- * The identifier should be an SQL identifier (i.e. delimited when
- * non-"normal").
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier);
-
- /**
- * Convert the specified name to a database-appropriate SQL identifier.
- */
- String convertNameToIdentifier(String name);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java
deleted file mode 100644
index e7806e7933..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseFinder.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-/**
- * This interface allows clients of the Dali db package to plug in a custom
- * strategy for comparing an identifier to the names of a collection of
- * database objects.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface DatabaseFinder {
-
- /**
- * Select and return from the specified list of database objects the
- * database object identified by the specified identifier.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier, DefaultCallback defaultCallback);
-
- /**
- * The platform-provided finder is passed a "default" callback that can be
- * used if appropriate.
- */
- interface DefaultCallback {
-
- /**
- * Select and return from the specified list of database objects the
- * database object identified by the specified identifier.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier);
-
- }
-
- /**
- * This finder searches for an exact match.
- */
- final class Simple implements DatabaseFinder {
- public static final DatabaseFinder INSTANCE = new Simple();
- public static DatabaseFinder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Simple() {
- super();
- }
- // search for an exact match on the name
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier, DefaultCallback defaultCallback) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equals(identifier)) {
- return databaseObject;
- }
- }
- return null;
- }
- @Override
- public String toString() {
- return "DatabaseFinder.Default"; //$NON-NLS-1$
- }
- }
-
- /**
- * This finder uses the passed in callback to search the list of database objects.
- */
- final class Default implements DatabaseFinder {
- public static final DatabaseFinder INSTANCE = new Default();
- public static DatabaseFinder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply use the callback
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier, DefaultCallback defaultCallback) {
- return defaultCallback.selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
- @Override
- public String toString() {
- return "DatabaseFinder.Default"; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java
deleted file mode 100644
index e9f755dbb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-/**
- * Common behavior to all database objects
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface DatabaseObject {
-
- /**
- * Return the database object's name.
- */
- String getName();
-
- /**
- * Return the database object's "identifier", which is the object's name
- * modified so it can be used in an SQL statement (e.g. if the name contains
- * special characters or is mixed case, it will be delimited, typically by
- * double-quotes).
- * Return null if the database object's identifier matches the specified
- * "default name".
- */
- String getIdentifier(String defaultName);
-
- /**
- * Return the database object's "identifier", which is the object's name
- * modified so it can be used in an SQL statement (e.g. if the name contains
- * special characters or is mixed case, it will be delimited, typically by
- * double-quotes).
- */
- String getIdentifier();
-
- /**
- * Return the database object's database.
- */
- Database getDatabase();
-
- /**
- * Return the database object's connection profile.
- */
- ConnectionProfile getConnectionProfile();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java
deleted file mode 100644
index 0406b42eba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-/**
- * Database foreign key
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface ForeignKey
- extends DatabaseObject, Comparable<ForeignKey>
-{
-
- // ********** tables **********
-
- /**
- * Return the foreign key's "base" table.
- */
- Table getBaseTable();
-
- /**
- * Return the foreign key's "referenced" table.
- */
- Table getReferencedTable();
-
-
- // ********** column pairs **********
-
- /**
- * Return the foreign key's column pairs.
- */
- Iterator<ColumnPair> columnPairs();
-
- /**
- * Return the size of the foreign key's column pairs.
- */
- int columnPairsSize();
-
- /**
- * Return the foreign key's single column pair. Throw an
- * IllegalStateException if the foreign key has more than one column pair.
- */
- ColumnPair getColumnPair();
-
- /**
- * Return the foreign key's "base" columns.
- */
- Iterator<Column> baseColumns();
-
- /**
- * Return the foreign key's "base" columns that are not part of the base
- * table's primary key. (The non-primary key base columns are not used to
- * generate basic attributes during entity generation.)
- */
- Iterator<Column> nonPrimaryKeyBaseColumns();
-
- /**
- * Return the foreign key's "referenced" columns.
- */
- Iterator<Column> referencedColumns();
-
- /**
- * Return whether the foreign key references the primary key of the
- * "referenced" table and that primary key has only a single column.
- * This can be used when determining JPA defaults.
- */
- boolean referencesSingleColumnPrimaryKey();
-
-
- // ********** JPA support **********
-
- /**
- * Return an appropriate name for an attribute that holds the entity
- * mapped to the foreign key's "referenced" table.
- */
- String getAttributeName();
-
- /**
- * If the name of the "base" column adheres to the JPA spec for a
- * default mapping (i.e. it ends with an underscore followed by the name
- * of the "referenced" column, and the "referenced" column is the single
- * primary key column of the "referenced" table), return the corresponding
- * default attribute name:
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * Return a null if it does not adhere to the JPA spec:
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null
- * ForeignKey(EMP.CUBICLE => CUBICLE.ID) => null
- */
- String getDefaultAttributeName();
-
- /**
- * Given the name of an attribute (field or property) that is mapped to the
- * foreign key,
- * build and return a string to be used as the value for the attribute's
- * JoinColumn annotation's 'name' element. Return null if the attribute
- * maps to the join column by default.
- * Precondition: The foreign key consists of a single column pair whose
- * referenced column is the single-column primary key of the foreign
- * key's referenced table.
- */
- String getJoinColumnAnnotationIdentifier(String attributeName);
-
- // ********** column pair interface **********
-
- /**
- * Pair up the foreign key's column pairs, matching each "base" column with
- * the appropriate "referenced" column.
- * @see #columnPairs()
- */
- interface ColumnPair extends Comparable<ColumnPair> {
-
- /**
- * Return the column pair's "base" column.
- */
- Column getBaseColumn();
-
- /**
- * Return the column pair's "referenced" column.
- */
- Column getReferencedColumn();
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java
deleted file mode 100644
index 346de5ba65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.db.internal.DTPConnectionProfileFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * The JPT DB plug-in lifecycle implementation.
- * Globally available connection profile factory.
- *
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class JptDbPlugin extends Plugin {
- private DTPConnectionProfileFactory connectionProfileFactory;
-
- private static JptDbPlugin INSTANCE; // sorta-final
-
- /**
- * Return the singleton JPT DB plug-in.
- */
- public static JptDbPlugin instance() {
- return INSTANCE;
- }
-
- /**
- * The constructor
- */
- public JptDbPlugin() {
- super();
- INSTANCE = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- this.connectionProfileFactory = DTPConnectionProfileFactory.instance();
- this.connectionProfileFactory.start();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- this.connectionProfileFactory.stop();
- this.connectionProfileFactory = null;
- INSTANCE = null;
- super.stop(context);
- }
-
- public ConnectionProfileFactory getConnectionProfileFactory() {
- return this.connectionProfileFactory;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java
deleted file mode 100644
index 984dfb537a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-
-/**
- * Database schema
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Schema
- extends DatabaseObject, Comparable<Schema>
-{
- /**
- * Return the schema's container; either a catalog or a database.
- */
- SchemaContainer getContainer();
-
-
- // ********** tables **********
-
- /**
- * Return the schema's tables.
- */
- Iterator<Table> tables();
-
- /**
- * Return the number of tables the schema contains.
- */
- int tablesSize();
-
- /**
- * Return the table with specified name. The name must be an exact match
- * of the table's name.
- * @see #getTableForIdentifier(String)
- */
- Table getTableNamed(String name);
-
- /**
- * Return the schema's table identifiers, sorted by name.
- */
- Iterator<String> sortedTableIdentifiers();
-
- /**
- * Return the table for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getTableNamed(String)
- */
- Table getTableForIdentifier(String identifier);
-
-
- // ********** sequences **********
-
- /**
- * Return the schema's sequences.
- */
- Iterator<Sequence> sequences();
-
- /**
- * Return the number of sequences the schema contains.
- */
- int sequencesSize();
-
- /**
- * Return the sequence with specified name. The name must be an exact match
- * of the sequence's name.
- * @see #getSequenceForIdentifier(String)
- */
- Sequence getSequenceNamed(String name);
-
- /**
- * Return the schema's sequence identifers, sorted by name.
- */
- Iterator<String> sortedSequenceIdentifiers();
-
- /**
- * Return the sequence for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getSequenceNamed(String)
- */
- Sequence getSequenceForIdentifier(String identifier);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java
deleted file mode 100644
index 26372f4a03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-/**
- * Schema "container" (i.e. Database or Catalog)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface SchemaContainer
- extends DatabaseObject
-{
-
- /**
- * Return the container's schemata.
- */
- Iterator<Schema> schemata();
-
- /**
- * Return the number of schemata in the container.
- */
- int schemataSize();
-
- /**
- * Return the schema with specified name. The name must be an exact match
- * of the schema's name.
- * @see #schemaNames()
- * @see #getSchemaForIdentifier(String)
- */
- Schema getSchemaNamed(String name);
-
- /**
- * Return the container's schema identifiers, sorted by name.
- */
- Iterator<String> sortedSchemaIdentifiers();
-
- /**
- * Return the schema for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #schemaIdentifiers()
- * @see #getSchemaNamed(String)
- */
- Schema getSchemaForIdentifier(String identifier);
-
- /**
- * Return the container's default schema, as defined by the database vendor.
- * In most cases the default schema's name will match the user name.
- */
- Schema getDefaultSchema();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java
deleted file mode 100644
index f4ccaa78f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-/**
- * Database sequence
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Sequence
- extends DatabaseObject, Comparable<Sequence>
-{
-
- /**
- * Return the sequence's schema.
- */
- Schema getSchema();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java
deleted file mode 100644
index ef4d334af0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db;
-
-import java.util.Iterator;
-
-/**
- * Database table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Table
- extends DatabaseObject, Comparable<Table>
-{
-
- /**
- * Return the table's schema.
- */
- Schema getSchema();
-
-
- // ********** columns **********
-
- /**
- * Return the table's columns.
- */
- Iterator<Column> columns();
-
- /**
- * Return the number of columns the table contains.
- */
- int columnsSize();
-
- /**
- * Return the column with specified name. The name must be an exact match
- * of the column's name.
- * @see #getColumnForIdentifier(String)
- */
- Column getColumnNamed(String name);
-
- /**
- * Return the table's column identifers, sorted by name.
- */
- Iterator<String> sortedColumnIdentifiers();
-
- /**
- * Return the column for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getColumnNamed(String)
- */
- Column getColumnForIdentifier(String identifier);
-
-
- // ********** primary key columns **********
-
- /**
- * Return the table's primary key columns.
- */
- Iterator<Column> primaryKeyColumns();
-
- /**
- * Return the number of primary key columns the table contains.
- */
- int primaryKeyColumnsSize();
-
- /**
- * Return the table's single primary key column. Throw an
- * IllegalStateException if the table has more than one primary key column.
- */
- Column getPrimaryKeyColumn();
-
-
- // ********** foreign keys **********
-
- /**
- * Return the table's foreign keys.
- */
- Iterator<ForeignKey> foreignKeys();
-
- /**
- * Return the number of foreign keys the table contains.
- */
- int foreignKeysSize();
-
-
- // ********** join table support **********
-
- /**
- * Return whether the table is possibly a "join" table
- * (i.e. it contains only 2 foreign keys). Whether the table *actually* is
- * a "join" table is determined by the semantics of the database design.
- */
- boolean isPossibleJoinTable();
-
- /**
- * Assuming the table is a "join" table, return the foreign key to the
- * "owning" table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableOwningForeignKey();
-
- /**
- * Assuming the table is a "join" table, return the foreign key to the
- * "non-owning" table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableNonOwningForeignKey();
-
- /**
- * Assuming the table is a "join" table, return whether its name matches
- * the JPA default (i.e. "OWNINGTABLE_NONOWNINGTABLE").
- * @see #isPossibleJoinTable()
- */
- boolean joinTableNameIsDefault();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java
deleted file mode 100644
index d1182e5f11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.List;
-
-import org.eclipse.jpt.db.Catalog;
-
-/**
- * Wrap a DTP Catalog
- */
-final class DTPCatalogWrapper
- extends DTPSchemaContainerWrapper
- implements Catalog
-{
- // the wrapped DTP catalog
- private final org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog;
-
-
- // ********** constructor **********
-
- DTPCatalogWrapper(DTPDatabaseWrapper database, org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- super(database, dtpCatalog);
- this.dtpCatalog = dtpCatalog;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().catalogChanged(this);
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- @SuppressWarnings("unchecked")
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemata() {
- return this.dtpCatalog.getSchemas();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.wraps(dtpSchema.getCatalog()) ?
- this.getSchema_(dtpSchema)
- :
- this.getDatabase().getSchema(dtpSchema);
- }
-
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.wraps(dtpTable.getSchema().getCatalog()) ?
- this.getTable_(dtpTable)
- :
- this.getDatabase().getTable(dtpTable);
- }
-
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.wraps(dtpColumn.getTable().getSchema().getCatalog()) ?
- this.getColumn_(dtpColumn)
- :
- this.getDatabase().getColumn(dtpColumn);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpCatalog.getName();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Catalog catalog) {
- return Collator.getInstance().compare(this.getName(), catalog.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) {
- return this.dtpCatalog == catalog;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java
deleted file mode 100644
index 709d8d1736..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-
-import org.eclipse.datatools.modelbase.dbdefinition.PredefinedDataTypeDefinition;
-import org.eclipse.datatools.modelbase.sql.datatypes.DataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.SimpleJavaType;
-
-/**
- * Wrap a DTP Column
- */
-final class DTPColumnWrapper
- extends DTPDatabaseObjectWrapper
- implements Column
-{
- // the wrapped DTP column
- private final org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn;
-
-
- // ********** constructor **********
-
- DTPColumnWrapper(DTPTableWrapper table, org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- super(table, dtpColumn);
- this.dtpColumn = dtpColumn;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().columnChanged(this);
- }
-
-
- // ********** Column implementation **********
-
- public String getName() {
- return this.dtpColumn.getName();
- }
-
- public DTPTableWrapper getTable() {
- return (DTPTableWrapper) this.getParent();
- }
-
- public boolean isPrimaryKeyColumn() {
- return this.getTable().primaryKeyColumnsContains(this);
- }
-
- public boolean isForeignKeyColumn() {
- return this.getTable().foreignKeyBaseColumnsContains(this);
- }
-
- public String getDataTypeName() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType == null) ? null : dataType.getName();
- }
-
- public String getJavaTypeDeclaration() {
- return this.getJavaType().declaration();
- }
-
- public JavaType getJavaType() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- convertToJPAJavaType(this.getJavaType((PredefinedDataType) dataType))
- :
- DEFAULT_JAVA_TYPE;
- }
-
- public String getPrimaryKeyJavaTypeDeclaration() {
- return this.getPrimaryKeyJavaType().declaration();
- }
-
- public JavaType getPrimaryKeyJavaType() {
- return convertToJPAPrimaryKeyJavaType(this.getJavaType());
- }
-
- private JavaType getJavaType(PredefinedDataType dataType) {
- // this is just a bit hacky: moving from a type declaration to a class name to a type declaration...
- String dtpJavaClassName = this.getDefinition(dataType).getJavaClassName();
- return new SimpleJavaType(ClassTools.classNameForTypeDeclaration(dtpJavaClassName));
- }
-
- private PredefinedDataTypeDefinition getDefinition(PredefinedDataType dataType) {
- return this.getDatabase().getDTPDefinition().getPredefinedDataTypeDefinition(dataType.getName());
- }
-
- public boolean dataTypeIsLOB() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- primitiveTypeIsLob(((PredefinedDataType) dataType).getPrimitiveType())
- :
- false;
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Column column) {
- return Collator.getInstance().compare(this.getName(), column.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Column column) {
- return this.dtpColumn == column;
- }
-
- @Override
- void clear() {
- // no state to clear
- }
-
-
- // ********** static methods **********
-
- /**
- * The JDBC spec says JDBC drivers should be able to map BLOBs and CLOBs
- * directly, but the JPA spec does not allow them.
- */
- private static JavaType convertToJPAJavaType(JavaType javaType) {
- if (javaType.equals(BLOB_JAVA_TYPE)) {
- return BYTE_ARRAY_JAVA_TYPE;
- }
- if (javaType.equals(CLOB_JAVA_TYPE)) {
- return STRING_JAVA_TYPE;
- }
- return javaType;
- }
-
- /**
- * The JPA spec [2.1.4] says only the following types are allowed in
- * primary key fields:
- * [variable] primitives
- * [variable] primitive wrappers
- * java.lang.String
- * java.util.Date
- * java.sql.Date
- */
- private static JavaType convertToJPAPrimaryKeyJavaType(JavaType javaType) {
- if (javaType.isVariablePrimitive()
- || javaType.isVariablePrimitiveWrapper()
- || javaType.equals(STRING_JAVA_TYPE)
- || javaType.equals(UTIL_DATE_JAVA_TYPE)
- || javaType.equals(SQL_DATE_JAVA_TYPE)) {
- return javaType;
- }
- if (javaType.equals(BIG_DECIMAL_JAVA_TYPE)) {
- return LONG_JAVA_TYPE; // ??
- }
- if (javaType.equals(SQL_TIME_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- if (javaType.equals(SQL_TIMESTAMP_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- // all the other typical types are pretty much un-mappable - return String(?)
- return STRING_JAVA_TYPE;
- }
-
- private static boolean primitiveTypeIsLob(PrimitiveType primitiveType) {
- return (primitiveType == PrimitiveType.BINARY_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL);
- }
-
-
- // ***** some constants used when converting the column to a Java attribute
- // TODO Object is the default?
- private static final JavaType DEFAULT_JAVA_TYPE = new SimpleJavaType(java.lang.Object.class);
-
- private static final JavaType BLOB_JAVA_TYPE = new SimpleJavaType(java.sql.Blob.class);
- private static final JavaType BYTE_ARRAY_JAVA_TYPE = new SimpleJavaType(byte[].class);
-
- private static final JavaType CLOB_JAVA_TYPE = new SimpleJavaType(java.sql.Clob.class);
- private static final JavaType STRING_JAVA_TYPE = new SimpleJavaType(java.lang.String.class);
-
- private static final JavaType UTIL_DATE_JAVA_TYPE = new SimpleJavaType(java.util.Date.class);
- private static final JavaType SQL_DATE_JAVA_TYPE = new SimpleJavaType(java.sql.Date.class);
- private static final JavaType SQL_TIME_JAVA_TYPE = new SimpleJavaType(java.sql.Time.class);
- private static final JavaType SQL_TIMESTAMP_JAVA_TYPE = new SimpleJavaType(java.sql.Timestamp.class);
-
- private static final JavaType BIG_DECIMAL_JAVA_TYPE = new SimpleJavaType(java.math.BigDecimal.class);
- private static final JavaType LONG_JAVA_TYPE = new SimpleJavaType(long.class);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java
deleted file mode 100644
index c128831dd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener1;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.ConnectionProfileListener;
-import org.eclipse.jpt.db.DatabaseFinder;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap the DTP ProfileManager in yet another singleton.
- */
-public final class DTPConnectionProfileFactory
- implements ConnectionProfileFactory
-{
- private ProfileManager dtpProfileManager;
-
- private LocalProfileListener profileListener;
-
-
- // ********** singleton **********
-
- private static final DTPConnectionProfileFactory INSTANCE = new DTPConnectionProfileFactory();
-
- public static DTPConnectionProfileFactory instance() {
- return INSTANCE;
- }
-
- /**
- * 'private' to ensure singleton
- */
- private DTPConnectionProfileFactory() {
- super();
- }
-
-
- // ********** lifecycle **********
-
- /**
- * called by plug-in
- */
- public synchronized void start() {
- this.dtpProfileManager = ProfileManager.getInstance();
- this.profileListener = new LocalProfileListener();
- this.dtpProfileManager.addProfileListener(this.profileListener);
- }
-
- /**
- * called by plug-in
- */
- public synchronized void stop() {
- this.dtpProfileManager.removeProfileListener(this.profileListener);
- this.profileListener = null;
- this.dtpProfileManager = null;
- }
-
-
- // ********** connection profiles **********
-
- public ConnectionProfile buildConnectionProfile(String name, DatabaseFinder finder) {
- for (IConnectionProfile dtpProfile : this.dtpProfileManager.getProfiles()) {
- if (dtpProfile.getName().equals(name)) {
- return new DTPConnectionProfileWrapper(dtpProfile, finder);
- }
- }
- return null;
- }
-
- public ConnectionProfile buildConnectionProfile(String name) {
- return this.buildConnectionProfile(name, DatabaseFinder.Simple.instance());
- }
-
- public Iterator<String> connectionProfileNames() {
- return new TransformationIterator<IConnectionProfile, String>(this.dtpConnectionProfiles()) {
- @Override
- protected String transform(IConnectionProfile dtpProfile) {
- return dtpProfile.getName();
- }
- };
- }
-
- private Iterator<IConnectionProfile> dtpConnectionProfiles() {
- return new ArrayIterator<IConnectionProfile>(this.dtpProfileManager.getProfiles());
- }
-
-
- // ********** listeners **********
-
- public void addConnectionProfileListener(ConnectionProfileListener listener) {
- this.profileListener.addConnectionProfileListener(listener);
- }
-
- public void removeConnectionProfileListener(ConnectionProfileListener listener) {
- this.profileListener.removeConnectionProfileListener(listener);
- }
-
-
- // ********** listener **********
-
- /**
- * Forward events to the factory's listeners.
- */
- private class LocalProfileListener implements IProfileListener1 {
- private Vector<ConnectionProfileListener> listeners = new Vector<ConnectionProfileListener>();
-
- LocalProfileListener() {
- super();
- }
-
- void addConnectionProfileListener(ConnectionProfileListener listener) {
- this.listeners.add(listener);
- }
-
- void removeConnectionProfileListener(ConnectionProfileListener listener) {
- this.listeners.remove(listener);
- }
-
- private Iterator<ConnectionProfileListener> listeners() {
- return new CloneIterator<ConnectionProfileListener>(this.listeners);
- }
-
- // ********** IProfileListener implementation **********
-
- public void profileAdded(IConnectionProfile dtpProfile) {
- String name = dtpProfile.getName();
- for (Iterator<ConnectionProfileListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().connectionProfileAdded(name);
- }
- }
-
- public void profileChanged(IConnectionProfile dtpProfile, String oldName, String oldDescription, Boolean oldAutoConnect) {
- String newName = dtpProfile.getName();
- if ( ! newName.equals(oldName)) {
- for (Iterator<ConnectionProfileListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().connectionProfileRenamed(oldName, newName);
- }
- }
- }
-
- public void profileChanged(IConnectionProfile dtpProfile) {
- // this method shouldn't be called on IProfileListener1
- throw new UnsupportedOperationException();
- }
-
- public void profileDeleted(IConnectionProfile dtpProfile) {
- String name = dtpProfile.getName();
- for (Iterator<ConnectionProfileListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().connectionProfileRemoved(name);
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
deleted file mode 100644
index ef0b0eec35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,549 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.ConnectEvent;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IManagedConnection;
-import org.eclipse.datatools.connectivity.IManagedConnectionOfflineListener;
-import org.eclipse.datatools.connectivity.drivers.DriverManager;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.sqm.core.connection.ConnectionInfo;
-import org.eclipse.datatools.sqltools.core.DatabaseIdentifier;
-import org.eclipse.datatools.sqltools.core.profile.ProfileUtil;
-import org.eclipse.jpt.db.ConnectionListener;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.DatabaseFinder;
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-
-/**
- * Wrap a DTP ConnectionProfile
- */
-final class DTPConnectionProfileWrapper
- implements DTPDatabaseObject, ConnectionProfile
-{
- // the wrapped DTP connection profile
- private final IConnectionProfile dtpConnectionProfile;
-
- // finder supplied by the JPA platform (determines case-sensitivity, etc.)
- private final DatabaseFinder finder;
-
- // callback passed to the finder
- private final DatabaseFinder.DefaultCallback databaseFinderCallback;
-
- // the DTP managed connection we listen to
- private final IManagedConnection dtpManagedConnection;
-
- // forward events from the DTP managed connection above;
- // we listen and propagate events iff we have listeners ourselves
- private final LocalConnectionListener connectionListener;
-
- // lazy-initialized, and deleted at disconnect
- private DTPDatabaseWrapper database;
-
-
- // ********** constants **********
-
- private static final String LIVE_DTP_CONNECTION_TYPE = "java.sql.Connection"; //$NON-NLS-1$
-
- private static final String OFFLINE_DTP_CONNECTION_TYPE = ConnectionInfo.class.getName();
-
- private static final String DATABASE_PRODUCT_PROP_ID = "org.eclipse.datatools.connectivity.server.version"; //$NON-NLS-1$
-
-
- // ********** constructor **********
-
- DTPConnectionProfileWrapper(IConnectionProfile dtpConnectionProfile, DatabaseFinder finder) {
- super();
- this.dtpConnectionProfile = dtpConnectionProfile;
- this.finder = finder;
- this.databaseFinderCallback = new DatabaseFinderCallback();
- this.dtpManagedConnection = this.buildDTPManagedConnection();
- this.connectionListener = new LocalConnectionListener();
- // don't listen to the managed connection yet
- }
-
- private IManagedConnection buildDTPManagedConnection() {
- String connectionType = this.dtpConnectionProfile.supportsWorkOfflineMode() ?
- OFFLINE_DTP_CONNECTION_TYPE : LIVE_DTP_CONNECTION_TYPE;
- return this.dtpConnectionProfile.getManagedConnection(connectionType);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpConnectionProfile.getName();
- }
-
- public String getIdentifier(String javaIdentifier) {
- // connection profiles do not have "identifiers"
- throw new UnsupportedOperationException();
- }
-
- public String getIdentifier() {
- // connection profiles do not have "identifiers"
- throw new UnsupportedOperationException();
- }
-
-
- // ********** DTPDatabaseObject implementation **********
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this;
- }
-
- public synchronized DTPDatabaseWrapper getDatabase() {
- if (this.database == null) {
- this.database = this.buildDatabase();
- }
- return this.database;
- }
-
-
- // ********** ConnectionProfile implementation **********
-
- // ***** properties
- public String getProviderID() {
- return this.dtpConnectionProfile.getProviderId();
- }
-
- public String getInstanceID() {
- return this.dtpConnectionProfile.getInstanceID();
- }
-
- public String getDatabaseName() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID);
- }
-
- public String getDatabaseProduct() {
- return this.getProperty(DATABASE_PRODUCT_PROP_ID);
- }
-
- public String getDatabaseVendor() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID);
- }
-
- public String getDatabaseVersion() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);
- }
-
- public String getDriverClassName() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID);
- }
-
- public String getURL() {
- return this.getProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID);
- }
-
- public String getUserName() {
- String userName = this.getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
- // 208946 handle username like "sys as sysdba" on Oracle
- int index = userName.indexOf(' ');
- return (index == -1) ? userName : userName.substring(0, index);
- }
-
- public String getUserPassword() {
- return this.getProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID);
- }
-
- public String getDriverDefinitionID() {
- return this.getProperty(DRIVER_DEFINITION_PROP_ID);
- }
-
- public String getDriverJarList() {
- return DriverManager.getInstance().getDriverInstanceByID(this.getDriverDefinitionID()).getJarList();
- }
-
- public String getDriverName() {
- return DriverManager.getInstance().getDriverInstanceByID(this.getDriverDefinitionID()).getName();
- }
-
- // ***** connection
- public boolean isActive() {
- return this.isConnected() || this.isWorkingOffline();
- }
-
- public boolean isInactive() {
- return ! this.isActive();
- }
-
- public boolean isConnected() {
- return this.dtpManagedConnection.isConnected()
- && ! this.dtpManagedConnection.isWorkingOffline();
- }
-
- public boolean isDisconnected() {
- return ! this.isConnected();
- }
-
- public void connect() {
- if (this.isDisconnected()) {
- this.checkStatus(this.dtpConnectionProfile.connect());
- }
- }
-
- public void disconnect() {
- this.checkStatus(this.dtpConnectionProfile.disconnect());
- }
-
- // ***** off-line support
- public boolean isWorkingOffline() {
- return this.dtpManagedConnection.isWorkingOffline();
- }
-
- public boolean supportsWorkOfflineMode() {
- return this.dtpConnectionProfile.supportsWorkOfflineMode();
- }
-
- public IStatus saveWorkOfflineData() {
- return this.dtpConnectionProfile.saveWorkOfflineData();
- }
-
- public boolean canWorkOffline() {
- return this.dtpConnectionProfile.canWorkOffline();
- }
-
- public IStatus workOffline() {
- return this.dtpConnectionProfile.workOffline();
- }
-
- // ***** listeners
- public synchronized void addConnectionListener(ConnectionListener listener) {
- if (this.hasNoListeners()) { // first listener added
- this.startListening();
- }
- this.connectionListener.addConnectionListener(listener);
- }
-
- private void startListening() {
- this.dtpManagedConnection.addConnectionListener(this.connectionListener);
- if (this.database != null) { // don't trigger database creation
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.startListening();
- }
- }
- }
-
- public synchronized void removeConnectionListener(ConnectionListener listener) {
- this.connectionListener.removeConnectionListener(listener);
- if (this.hasNoListeners()) { // last listener removed
- this.stopListening();
- }
- }
-
- private void stopListening() {
- if (this.database != null) { // don't trigger database creation
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.stopListening();
- }
- }
- this.dtpManagedConnection.removeConnectionListener(this.connectionListener);
- }
-
- boolean hasNoListeners() {
- return this.connectionListener.hasNoListeners();
- }
-
- boolean hasAnyListeners() {
- return this.connectionListener.hasAnyListeners();
- }
-
-
- // ********** internal methods **********
-
- private void checkStatus(IStatus status) {
- if (status.isOK()) {
- return;
- }
- if (status.isMultiStatus()) {
- for (IStatus child : status.getChildren()) {
- this.checkStatus(child); // recurse, looking for the first error
- }
- }
- throw new RuntimeException(status.getMessage(), status.getException());
- }
-
- private DTPDatabaseWrapper buildDatabase() {
- if (this.isInactive()) {
- return null;
- }
-
- if (this.isWorkingOffline()) {
- ConnectionInfo connectionInfo = (ConnectionInfo) this.dtpManagedConnection.getConnection().getRawConnection();
- return new DTPDatabaseWrapper(this, connectionInfo.getSharedDatabase());
- }
-
- // TODO see DTP bug 202306
- // pass connect=true in to ProfileUtil.getDatabase()
- // there is a bug mentioned in a comment:
- // "during the profile connected event notification,
- // IManagedConnection is connected while IConnectionProfile is not"
- // so, some hackery here to handle hackery there
- return new DTPDatabaseWrapper(this, ProfileUtil.getDatabase(new DatabaseIdentifier(this.getName(), this.getDatabaseName()), true));
- }
-
- synchronized void clearDatabase() {
- if (this.database != null) {
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.stopListening();
- }
- this.database = null;
- }
- }
-
- /**
- * This is called whenever we need to find a component by identifier
- * (e.g. Table.getColumnForIdentifier(String)). We channel all the calls to here
- * and then we delegate to the JPA platform-supplied "database finder".
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- return this.finder.selectDatabaseObjectForIdentifier(databaseObjects, identifier, this.databaseFinderCallback);
- }
-
- /**
- * The default "database finder" calls back to here so we can delegate to
- * the database, which contains all the information necessary to properly
- * match identifiers.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier_(T[] databaseObjects, String identifier) {
- // the database should not be null here - call its internal method
- return this.database.selectDatabaseObjectForIdentifier_(databaseObjects, identifier);
- }
-
- void databaseChanged(DTPDatabaseWrapper db) {
- this.connectionListener.databaseChanged(db);
- }
-
- void catalogChanged(DTPCatalogWrapper catalog) {
- this.connectionListener.catalogChanged(catalog);
- }
-
- void schemaChanged(DTPSchemaWrapper schema) {
- this.connectionListener.schemaChanged(schema);
- }
-
- void sequenceChanged(DTPSequenceWrapper sequence) {
- this.connectionListener.sequenceChanged(sequence);
- }
-
- void tableChanged(DTPTableWrapper table) {
- this.connectionListener.tableChanged(table);
- }
-
- void columnChanged(DTPColumnWrapper column) {
- this.connectionListener.columnChanged(column);
- }
-
- void foreignKeyChanged(DTPForeignKeyWrapper foreignKey) {
- this.connectionListener.foreignKeyChanged(foreignKey);
- }
-
- private String getProperty(String propertyName) {
- return this.dtpConnectionProfile.getBaseProperties().getProperty(propertyName);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(ConnectionProfile connectionProfile) {
- return Collator.getInstance().compare(this.getName(), connectionProfile.getName());
- }
-
-
- // ********** overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** DTP connection listener **********
-
- /**
- * This listener translates and forwards IManagedConnectionListener and
- * IManagedConnectionOfflineListener events to ConnectionListeners.
- */
- class LocalConnectionListener implements IManagedConnectionOfflineListener {
- private Vector<ConnectionListener> listeners = new Vector<ConnectionListener>();
-
- LocalConnectionListener() {
- super();
- }
-
- void addConnectionListener(ConnectionListener listener) {
- this.listeners.add(listener);
- }
-
- void removeConnectionListener(ConnectionListener listener) {
- this.listeners.remove(listener);
- }
-
- private Iterator<ConnectionListener> listeners() {
- return new CloneIterator<ConnectionListener>(this.listeners);
- }
-
- boolean hasNoListeners() {
- return this.listeners.isEmpty();
- }
-
- boolean hasAnyListeners() {
- return ! this.listeners.isEmpty();
- }
-
-
- // ********** IManagedConnectionListener implementation **********
-
- // off-line or inactive => live
- public void opened(ConnectEvent event) {
- // do not build the database here - it is built on-demand
- // forward event to listeners
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().opened(DTPConnectionProfileWrapper.this);
- }
- }
-
- /**
- * This method is never called from the base DTP code.
- * Perhaps DTP extenders call it....
- * @see ManagedConnection#fireModifiedEvent(Object)
- * which is never called...
- */
- public void modified(ConnectEvent event) {
- // forward event to listeners
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().modified(DTPConnectionProfileWrapper.this);
- }
- }
-
- public boolean okToClose(ConnectEvent event) {
- // forward event to listeners
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- if ( ! stream.next().okToClose(DTPConnectionProfileWrapper.this)) {
- return false;
- }
- }
- return true;
- }
-
- public void aboutToClose(ConnectEvent event) {
- // forward event to listeners
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().aboutToClose(DTPConnectionProfileWrapper.this);
- }
- }
-
- // live or off-line => inactive
- public void closed(ConnectEvent event) {
- // clear the database
- DTPConnectionProfileWrapper.this.clearDatabase();
- // forward event to listeners
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().closed(DTPConnectionProfileWrapper.this);
- }
- }
-
-
- // ********** IManagedConnectionOfflineListener implementation **********
-
- // live => off-line
- public boolean okToDetach(ConnectEvent event) {
- // convert the event to an "ok to close" event;
- // we are "closing" the live connection
- return this.okToClose(event);
- }
-
- // live => off-line
- public void aboutToDetach(ConnectEvent event) {
- // convert the event to a "close" event;
- // we are "closing" the live connection
- this.closed(event);
- }
-
- // inactive or live => off-line
- public void workingOffline(ConnectEvent event) {
- // convert the event to an "open" event;
- // we are "opening" the off-line connection
- this.opened(event);
- }
-
- // off-line => live
- public void aboutToAttach(ConnectEvent event) {
- // convert the event to an "close" event;
- // we are "closing" the off-line connection
- this.closed(event);
- }
-
-
- // ********** internal methods **********
-
- void databaseChanged(DTPDatabaseWrapper db) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().databaseChanged(DTPConnectionProfileWrapper.this, db);
- }
- }
-
- void catalogChanged(DTPCatalogWrapper catalog) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().catalogChanged(DTPConnectionProfileWrapper.this, catalog);
- }
- }
-
- void schemaChanged(DTPSchemaWrapper schema) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().schemaChanged(DTPConnectionProfileWrapper.this, schema);
- }
- }
-
- void sequenceChanged(DTPSequenceWrapper sequence) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().sequenceChanged(DTPConnectionProfileWrapper.this, sequence);
- }
- }
-
- void tableChanged(DTPTableWrapper table) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().tableChanged(DTPConnectionProfileWrapper.this, table);
- }
- }
-
- void columnChanged(DTPColumnWrapper column) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().columnChanged(DTPConnectionProfileWrapper.this, column);
- }
- }
-
- void foreignKeyChanged(DTPForeignKeyWrapper foreignKey) {
- for (Iterator<ConnectionListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().foreignKeyChanged(DTPConnectionProfileWrapper.this, foreignKey);
- }
- }
-
- }
-
-
- // ********** default DatabaseFinder **********
-
- class DatabaseFinderCallback implements DatabaseFinder.DefaultCallback {
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- // call back to the internal method
- return DTPConnectionProfileWrapper.this.selectDatabaseObjectForIdentifier_(databaseObjects, identifier);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java
deleted file mode 100644
index c976fe4b39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import org.eclipse.jpt.db.DatabaseObject;
-
-/**
- * DTP database object
- */
-public interface DTPDatabaseObject extends DatabaseObject {
-
- /**
- * covariant override
- */
- DTPConnectionProfileWrapper getConnectionProfile();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java
deleted file mode 100644
index a4cfae644c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.connectivity.sqm.core.rte.RefreshManager;
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * DTP Catalog Object Wrapper base class
- */
-abstract class DTPDatabaseObjectWrapper
- implements DTPDatabaseObject
-{
- // we need a way to get to the connection profile
- private final DTPDatabaseObject parent;
-
- // listen for the "catalog object" being refreshed
- private final ICatalogObjectListener catalogObjectListener;
-
- // listen for this DTP catalog object to refresh
- final ICatalogObject catalogObject;
-
-
- // ********** construction/initialization **********
-
- DTPDatabaseObjectWrapper(DTPDatabaseObject parent, Object dtpObject) {
- super();
- this.parent = parent;
- if (this.getConnectionProfile().isConnected()) {
- // we only listen to "live" connections (as opposed to "off-line" connections)
- this.catalogObject = (ICatalogObject) dtpObject;
- this.catalogObjectListener = this.buildCatalogObjectListener();
- if (this.getConnectionProfile().hasAnyListeners()) {
- this.startListening();
- }
- } else {
- this.catalogObject = null;
- this.catalogObjectListener = null;
- }
- }
-
- private ICatalogObjectListener buildCatalogObjectListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged(ICatalogObject dmElement, int eventType) {
- if (dmElement == DTPDatabaseObjectWrapper.this.catalogObject) {
- // 'eventType' doesn't seem to be very useful, so drop it
- DTPDatabaseObjectWrapper.this.catalogObjectChanged();
- }
- }
- };
- }
-
- // typically, notify the connection profile something has changed
- void catalogObjectChanged() {
- this.clear();
- }
-
- /**
- * The DTP object has changed, clear the wrapper's state so it will be
- * synchronized on-demand.
- */
- abstract void clear();
-
-
-
- // ********** queries **********
-
- DTPDatabaseObject getParent() {
- return this.parent;
- }
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this.parent.getConnectionProfile();
- }
-
- public DTPDatabaseWrapper getDatabase() {
- return this.getConnectionProfile().getDatabase();
- }
-
- /**
- * This is called by whenever we need to find a component by identifier
- * (e.g. Table.getColumnForIdentifier(String)). We channel all the calls to the
- * connection profile, which then delegates to the JPA platform-supplied
- * "database finder".
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- return this.getConnectionProfile().selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
-
- /**
- * Convenience method.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(T[] databaseObjects, String name) {
- for (T dbObject : databaseObjects) {
- if (dbObject.getName().equals(name)) {
- return dbObject;
- }
- }
- return null;
- }
-
- /**
- * Examples:
- * Oracle etc.
- * Table(FOO) vs. "Foo" => null
- * Table(BAR) vs. "Foo" => "BAR"
- * Table(Foo) vs. "Foo" => "\"Foo\""
- * Table(Bar) vs. "Foo" => "\"Bar\""
- *
- * PostgreSQL etc.
- * Table(foo) vs. "Foo" => null
- * Table(bar) vs. "Foo" => "bar"
- * Table(Foo) vs. "Foo" => "\"Foo\""
- * Table(Bar) vs. "Foo" => "\"Bar\""
- *
- * SQL Server etc.
- * Table(Foo) vs. "Foo" => null
- * Table(foo) vs. "Foo" => "foo"
- * Table(bar) vs. "Foo" => "bar"
- * Table(Bar) vs. "Foo" => "Bar"
- */
- public String getIdentifier(String defaultName) {
- return this.getDatabase().convertNameToIdentifier(this.getName(), defaultName);
- }
-
- /**
- * Examples:
- * Oracle etc.
- * Table(FOO) => "FOO"
- * Table(Foo) => "\"Foo\""
- * Table(foo) => "\"foo\""
- * Table(foo++) => "\"foo++\""
- * Table(f"o) => "\"f\"\"o++\"" (i.e. "f""o")
- *
- * PostgreSQL etc.
- * Table(FOO) => "\"FOO\""
- * Table(Foo) => "\"Foo\""
- * Table(foo) => "foo"
- * Table(foo++) => "\"foo++\""
- * Table(f"o) => "\"f\"\"o++\"" (i.e. "f""o")
- *
- * SQL Server etc.
- * Table(FOO) => "FOO"
- * Table(Foo) => "Foo"
- * Table(foo) => "foo"
- * Table(foo++) => "\"foo++\""
- * Table(f"o) => "\"f\"\"o++\"" (i.e. "f""o")
- */
- public String getIdentifier() {
- return this.getDatabase().convertNameToIdentifier(this.getName());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** listening to DTP database object **********
-
- // this should only be called when the connection profile is "live" and has listeners
- void startListening() {
- this.checkListener();
- RefreshManager.getInstance().AddListener(this.catalogObject, this.catalogObjectListener);
- }
-
- // this should only be called when the connection profile is "live" and has no listeners
- void stopListening() {
- this.checkListener();
- RefreshManager.getInstance().removeListener(this.catalogObject, this.catalogObjectListener);
- }
-
- private void checkListener() {
- if (this.catalogObjectListener == null) {
- throw new IllegalStateException("the catalog listener is null"); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
deleted file mode 100644
index 04b9870ab0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,1075 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP Database.
- *
- * Sometimes the database will directly hold schemata; but if the database
- * supports catalogs, it will not hold the schemata directly, but will delegate
- * to the "default" catalog.
- *
- * Note:
- * We use "name" when dealing with the unmodified name of a database object
- * as supplied by the database itself (i.e. it is not delimited and it is always
- * case-sensitive).
- * We use "identifier" when dealing with a string representation of a database
- * object name (i.e. it may be delimited and, depending on the vendor, it may
- * be case-insensitive).
- */
-final class DTPDatabaseWrapper
- extends DTPSchemaContainerWrapper
- implements Database
-{
- // the wrapped DTP database
- private final org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
-
- // lazy-initialized, sorted
- private DTPCatalogWrapper[] catalogs;
-
- // lazy-initialized - but it can be 'null' so we use a flag
- private DTPCatalogWrapper defaultCatalog;
- private boolean defaultCatalogCalculated = false;
-
-
- private static final DTPCatalogWrapper[] EMPTY_CATALOGS = new DTPCatalogWrapper[0];
-
-
- // ********** constructor **********
-
- DTPDatabaseWrapper(DTPConnectionProfileWrapper connectionProfile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- super(connectionProfile, dtpDatabase);
- this.dtpDatabase = dtpDatabase;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().databaseChanged(this);
- }
-
- @Override
- public DTPDatabaseWrapper getDatabase() {
- return this;
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- @SuppressWarnings("unchecked")
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemata() {
- return this.dtpDatabase.getSchemas();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getSchema_(dtpSchema);
- }
-
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getTable_(dtpTable);
- }
-
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getColumn_(dtpColumn);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpDatabase.getName();
- }
-
-
- // ********** Database implementation **********
-
- public String getVendorName() {
- return this.dtpDatabase.getVendor();
- }
-
- public String getVersion() {
- return this.dtpDatabase.getVersion();
- }
-
- // override to make method public since it's in the Database interface
- @Override
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects, String identifier) {
- return super.selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
-
- // ***** catalogs
-
- public boolean supportsCatalogs() {
- // if the DTP database does not have any schemata, it must have catalogs...
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.getDTPSchemata();
- return (dtpSchemata == null) || dtpSchemata.isEmpty();
- }
-
- public Iterator<Catalog> catalogs() {
- return new ArrayIterator<Catalog>(this.getCatalogs());
- }
-
- private Iterator<DTPCatalogWrapper> catalogWrappers() {
- return new ArrayIterator<DTPCatalogWrapper>(this.getCatalogs());
- }
-
- private synchronized DTPCatalogWrapper[] getCatalogs() {
- if (this.catalogs == null) {
- this.catalogs = this.buildCatalogs();
- }
- return this.catalogs;
- }
-
- private DTPCatalogWrapper[] buildCatalogs() {
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- if ((dtpCatalogs == null) || dtpCatalogs.isEmpty()) {
- return EMPTY_CATALOGS;
- }
- DTPCatalogWrapper[] result = new DTPCatalogWrapper[dtpCatalogs.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPCatalogWrapper(this, dtpCatalogs.get(i));
- }
- return CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.dtpDatabase.getCatalogs();
- }
-
- public int catalogsSize() {
- return this.getCatalogs().length;
- }
-
- /**
- * return the catalog for the specified DTP catalog
- */
- DTPCatalogWrapper getCatalog(org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- for (DTPCatalogWrapper catalog : this.getCatalogs()) {
- if (catalog.wraps(dtpCatalog)) {
- return catalog;
- }
- }
- throw new IllegalArgumentException("invalid DTP catalog: " + dtpCatalog); //$NON-NLS-1$
- }
-
- public DTPCatalogWrapper getCatalogNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getCatalogs(), name);
- }
-
- public Iterator<String> sortedCatalogIdentifiers() {
- // the catalogs are already sorted
- return new TransformationIterator<DTPCatalogWrapper, String>(this.catalogWrappers()) {
- @Override
- protected String transform(DTPCatalogWrapper next) {
- return next.getIdentifier();
- }
- };
- }
-
- public DTPCatalogWrapper getCatalogForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getCatalogs(), identifier);
- }
-
- public synchronized DTPCatalogWrapper getDefaultCatalog() {
- if ( ! this.defaultCatalogCalculated) {
- this.defaultCatalogCalculated = true;
- this.defaultCatalog = this.buildDefaultCatalog();
- }
- return this.defaultCatalog;
- }
-
- private DTPCatalogWrapper buildDefaultCatalog() {
- return this.supportsCatalogs() ? this.getVendor().getDefaultCatalog(this) : null;
- }
-
- // ***** schemata
-
- @Override
- synchronized DTPSchemaWrapper[] getSchemata() {
- DTPCatalogWrapper cat = this.getDefaultCatalog();
- return (cat == null) ? super.getSchemata() : cat.getSchemata();
- }
-
- DTPSchemaWrapper getDefaultSchema(DTPSchemaContainerWrapper schemaContainer) {
- return this.getVendor().getDefaultSchema(schemaContainer);
- }
-
-
- // ********** names vs. identifiers **********
-
- /**
- * Convert the specified name to an identifier. Return null if the resulting
- * identifier matches the specified default name.
- */
- String convertNameToIdentifier(String name, String defaultName) {
- return this.getVendor().convertNameToIdentifier(name, defaultName);
- }
-
- /**
- * Convert the specified name to an identifier.
- */
- public String convertNameToIdentifier(String name) {
- return this.getVendor().convertNameToIdentifier(name);
- }
-
- /**
- * Return the database object identified by the specified identifier. If
- * the identifier is "delimited" (typically with double-quotes), it will be
- * used without any folding. If the name is "normal" (i.e. not delimited),
- * it will be folded to the appropriate case (typically uppercase).
- *
- * Since the database has the appropriate state to compare identifiers and
- * names, the connection profile delegates to here when using the default
- * "database finder".
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier_(T[] databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamed(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- /**
- * Convert the specified identifier to a name.
- */
- String convertIdentifierToName(String identifier) {
- return this.getVendor().convertIdentifierToName(identifier);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Database database) {
- return Collator.getInstance().compare(this.getName(), database.getName());
- }
-
-
- // ********** internal methods **********
-
- DatabaseDefinition getDTPDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.dtpDatabase);
- }
-
- private Vendor getVendor() {
- return getVendor(this.getVendorName());
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.catalogs != null) {
- this.startCatalogs();
- }
- super.startListening();
- }
-
- private void startCatalogs() {
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.catalogs != null) {
- this.stopCatalogs();
- }
- super.stopListening();
- }
-
- private void stopCatalogs() {
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- void clear() {
- this.defaultCatalogCalculated = false;
- this.defaultCatalog = null;
- if (this.catalogs != null) {
- this.clearCatalogs();
- }
- super.clear();
- }
-
- private void clearCatalogs() {
- this.stopCatalogs();
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.clear();
- }
- this.catalogs = null;
- }
-
-
- // ********** vendors **********
-
- private static Vendor getVendor(String name) {
- Vendor vendor = getVendors().get(name);
- return (vendor != null) ? vendor : Default.INSTANCE;
- }
-
- /**
- * keyed by vendor name
- */
- private static HashMap<String, Vendor> Vendors;
-
- private static synchronized HashMap<String, Vendor> getVendors() {
- if (Vendors == null) {
- Vendors = buildVendors();
- }
- return Vendors;
- }
-
- private static HashMap<String, Vendor> buildVendors() {
- HashMap<String, Vendor> map = new HashMap<String, Vendor>(20);
- putVendor(map, Derby.INSTANCE);
- putVendor(map, HSQLDB.INSTANCE);
- putVendor(map, DB2.UDB);
- putVendor(map, DB2.UDB_I_SERIES);
- putVendor(map, DB2.UDB_Z_SERIES);
- putVendor(map, Informix.INSTANCE);
- putVendor(map, SQLServer.INSTANCE);
- putVendor(map, MySQL.INSTANCE);
- putVendor(map, Oracle.INSTANCE);
- putVendor(map, Postgres.INSTANCE);
- putVendor(map, MaxDB.INSTANCE);
- putVendor(map, Sybase.ASA);
- putVendor(map, Sybase.ASE);
- return map;
- }
-
- private static void putVendor(HashMap<String, Vendor> map, Vendor vendor) {
- String name = vendor.getName();
- if (map.put(name, vendor) != null) {
- throw new IllegalArgumentException("Duplicate vendor: " + name); //$NON-NLS-1$
- }
- }
-
-
- // ********** vendor classes **********
-
- /**
- * Delegate vendor-specific behavior to implementations of this class"
- * - default catalog and schema
- * - converting names to identifiers and vice-versa
- *
- * Note:
- * We use "name" when dealing with the unmodified name of a database object
- * as supplied by the database itself (i.e. it is not delimited and it is always
- * case-sensitive).
- * We use "identifier" when dealing with a string representation of a database
- * object name (i.e. it may be delimited and, depending on the vendor, it may
- * be case-insensitive).
- */
- private abstract static class Vendor {
-
- Vendor() {
- super();
- }
-
- /**
- * Return the vendor's name. This must match the name specified by the
- * DTP connection profile.
- */
- abstract String getName();
-
- /**
- * The SQL spec says a "normal" (non-delimited) identifier should be
- * folded to uppercase; but some databases do otherwise (e.g. Sybase).
- */
- Folder getFolder() {
- return Folder.UPPER;
- }
-
-
- // ********** default catalog and schema **********
-
- DTPCatalogWrapper getDefaultCatalog(DTPDatabaseWrapper database) {
- return database.getCatalogForIdentifier(this.getDefaultCatalogIdentifier(database));
- }
-
- /**
- * Typically, the name of the default catalog is the user name.
- */
- String getDefaultCatalogIdentifier(DTPDatabaseWrapper database) {
- return database.getConnectionProfile().getUserName();
- }
-
- DTPSchemaWrapper getDefaultSchema(DTPSchemaContainerWrapper sc) {
- return sc.getSchemaForIdentifier(this.getDefaultSchemaIdentifier(sc));
- }
-
- /**
- * Typically, the name of the default schema is the user name.
- */
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return sc.getDatabase().getConnectionProfile().getUserName();
- }
-
-
- // ********** name -> identifier **********
-
- /**
- * @see DTPDatabaseWrapper#convertNameToIdentifier(String, String)
- */
- final String convertNameToIdentifier(String name, String defaultName) {
- return this.nameRequiresDelimiters(name) ? this.delimitName(name)
- : this.normalNamesMatch(name, defaultName) ? null : name;
- }
-
- /**
- * @see DTPDatabaseWrapper#convertNameToIdentifier(String)
- */
- final String convertNameToIdentifier(String name) {
- return this.nameRequiresDelimiters(name) ? this.delimitName(name) : name;
- }
-
- /**
- * Return whether the specified database object name must be delimited
- * when used in an SQL statement.
- * If the name has any "special" characters (as opposed to letters,
- * digits, and other allowed characters [e.g. underscores]), it requires
- * delimiters.
- * If the name is mixed case and the database folds undelimited names
- * (to either uppercase or lowercase), it requires delimiters.
- */
- final boolean nameRequiresDelimiters(String name) {
- return (name.length() == 0) // an empty string must be delimited(?)
- || this.nameContainsAnySpecialCharacters(name)
- || this.nameIsNotFolded(name);
- }
-
- /**
- * Return whether the specified name contains any "special" characters
- * that require the name to be delimited.
- * Pre-condition: the specified name is not empty
- */
- final boolean nameContainsAnySpecialCharacters(String name) {
- char[] string = name.toCharArray();
- if (this.characterIsSpecialNameStart(string[0])) {
- return true;
- }
- for (int i = string.length; i-- > 1; ) { // note: stop at 1
- if (this.characterIsSpecialNamePart(string[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified character is "special" for the first
- * character of a name.
- * Typically, databases are more restrictive about what characters can
- * be used to *start* an identifier (as opposed to the characters
- * allowed for the remainder of the identifier).
- */
- final boolean characterIsSpecialNameStart(char c) {
- return ! this.characterIsNormalNameStart(c);
- }
-
- /**
- * Return whether the specified character is "normal" for the first
- * character of a name.
- * The first character of an identifier can be:
- * - a letter
- * - any of the other, vendor-specific, "normal" start characters
- */
- boolean characterIsNormalNameStart(char c) {
- // all vendors allow a letter
- return Character.isLetter(c)
- || this.characterIsNormalNameStart_(c);
- }
-
- private boolean characterIsNormalNameStart_(char c) {
- return arrayContains(this.getNormalNameStartCharacters(), c);
- }
-
- /**
- * Return the "normal" characters, beyond letters, for the
- * first character of a name.
- * Return null if there are no additional characters.
- */
- char[] getNormalNameStartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified character is "special" for the second and
- * subsequent characters of a name.
- */
- final boolean characterIsSpecialNamePart(char c) {
- return ! this.characterIsNormalNamePart(c);
- }
-
- /**
- * Return whether the specified character is "normal" for the second and
- * subsequent characters of a name.
- * The second and subsequent characters of a "normal" name can be:
- * - a letter
- * - a digit
- * - any of the other, vendor-specific, "normal" start characters
- * - any of the other, vendor-specific, "normal" part characters
- */
- boolean characterIsNormalNamePart(char c) {
- // all vendors allow a letter or digit
- return Character.isLetterOrDigit(c)
- || this.characterIsNormalNameStart_(c)
- || this.characterIsNormalNamePart_(c);
- }
-
- private boolean characterIsNormalNamePart_(char c) {
- return arrayContains(this.getNormalNamePartCharacters(), c);
- }
-
- /**
- * Return the "normal" characters, beyond letters and digits and the
- * "normal" first characters, for the second and subsequent characters
- * of an identifier. Return null if there are no additional characters.
- */
- char[] getNormalNamePartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified name is not folded to the database's
- * case, requiring it to be delimited.
- */
- final boolean nameIsNotFolded(String name) {
- return ! this.getFolder().stringIsFolded(name);
- }
-
- /**
- * Return whether the specified "normal" names match.
- */
- final boolean normalNamesMatch(String name1, String name2) {
- return this.normalIdentifiersAreCaseSensitive() ?
- name1.equals(name2)
- :
- name1.equalsIgnoreCase(name2);
- }
-
- /**
- * Typically, "normal" identifiers are case-insensitive.
- */
- final boolean normalIdentifiersAreCaseSensitive() {
- return this.getFolder().isCaseSensitive();
- }
-
- /**
- * Wrap the specified name in delimiters (typically double-quotes),
- * converting it to an identifier.
- */
- String delimitName(String name) {
- return StringTools.quote(name);
- }
-
-
- // ********** identifier -> name **********
-
- /**
- * @see DTPDatabaseWrapper#selectDatabaseObjectForIdentifier_(DatabaseObject[], String)
- */
- // not sure how to handle an empty string:
- // both "" and "\"\"" are converted to "" ...
- // convert "" to 'null' since empty strings must be delimited?
- final String convertIdentifierToName(String identifier) {
- return (identifier == null) ? null :
- this.identifierIsDelimited(identifier) ?
- StringTools.undelimit(identifier)
- :
- this.getFolder().fold(identifier);
- }
-
- /**
- * Return whether the specified identifier is "delimited".
- * The SQL-92 spec says identifiers should be delimited by
- * double-quotes; but some databases allow otherwise (e.g. Sybase).
- */
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsQuoted(identifier);
- }
-
-
- // ********** misc **********
-
- @Override
- public String toString() {
- return this.getName();
- }
-
- /**
- * static convenience method - array null check
- */
- static boolean arrayContains(char[] array, char c) {
- return (array != null) && CollectionTools.contains(array, c);
- }
-
- /**
- * Handle database-specific case-folding issues.
- */
- enum Folder {
- UPPER {
- @Override String fold(String string) { return string.toUpperCase(); }
- @Override boolean stringIsFolded(String string) { return StringTools.stringIsUppercase(string); }
- @Override boolean isCaseSensitive() { return false; }
- },
- LOWER {
- @Override String fold(String string) { return string.toLowerCase(); }
- @Override boolean stringIsFolded(String string) { return StringTools.stringIsLowercase(string); }
- @Override boolean isCaseSensitive() { return false; }
- },
- NONE {
- @Override String fold(String string) { return string; }
- @Override boolean stringIsFolded(String string) { return true; }
- @Override boolean isCaseSensitive() { return true; }
- };
- abstract String fold(String string);
- abstract boolean stringIsFolded(String string);
- abstract boolean isCaseSensitive();
- }
-
- }
-
- private static class Default extends Vendor {
- static final Vendor INSTANCE = new Default();
-
- private Default() {
- super();
- }
-
- @Override
- String getName() {
- return "Default Vendor"; //$NON-NLS-1$
- }
-
- }
-
- private static class Derby extends Vendor {
- static final Vendor INSTANCE = new Derby();
-
- private Derby() {
- super();
- }
-
- @Override
- String getName() {
- return "Derby"; //$NON-NLS-1$
- }
-
- /**
- * Derby has a single, unnamed catalog that contains all the schemata.
- */
- @Override
- String getDefaultCatalogIdentifier(DTPDatabaseWrapper database) {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * The default user name on Derby is "APP".
- */
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- String user = super.getDefaultSchemaIdentifier(sc);
- return ((user == null) || (user.length() == 0)) ?
- DEFAULT_USER_NAME
- :
- user;
- }
- private static final String DEFAULT_USER_NAME = "APP"; //$NON-NLS-1$
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_' };
-
- }
-
- private static class HSQLDB extends Vendor {
- static final Vendor INSTANCE = new HSQLDB();
-
- private HSQLDB() {
- super();
- }
-
- @Override
- String getName() {
- return "HSQLDB"; //$NON-NLS-1$
- }
-
- }
-
- private static class DB2 extends Vendor {
- static final Vendor UDB_I_SERIES = new DB2("DB2 UDB iSeries"); //$NON-NLS-1$
- static final Vendor UDB = new DB2("DB2 UDB"); //$NON-NLS-1$
- static final Vendor UDB_Z_SERIES = new DB2("DB2 UDB zSeries"); //$NON-NLS-1$
-
- private final String name;
-
- private DB2(String name) {
- super();
- this.name = name;
- }
-
- @Override
- String getName() {
- return this.name;
- }
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_' };
-
- }
-
- private static class Informix extends Vendor {
- static final Vendor INSTANCE = new Informix();
-
- private Informix() {
- super();
- }
-
- @Override
- String getName() {
- return "Informix"; //$NON-NLS-1$
- }
-
- @Override
- Folder getFolder() {
- return Folder.LOWER;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '$' };
-
- }
-
- private static class SQLServer extends Vendor {
- static final Vendor INSTANCE = new SQLServer();
-
- private SQLServer() {
- super();
- }
-
- @Override
- String getName() {
- return "SQL Server"; //$NON-NLS-1$
- }
-
- /**
- * The default schema on SQL Server for any database (catalog) is 'dbo'.
- */
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return DEFAULT_SCHEMA_NAME;
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- /**
- * By default, SQL Server identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- @Override
- Folder getFolder() {
- return Folder.NONE;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_', '@', '#' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '$' };
-
- /**
- * By default, SQL Server delimits identifiers with brackets ([]); but it
- * can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
- }
-
- private static class MySQL extends Vendor {
- static final Vendor INSTANCE = new MySQL();
-
- private MySQL() {
- super();
- }
-
- @Override
- String getName() {
- return "MySql"; //$NON-NLS-1$
- }
-
- /**
- * MySQL is a bit unusual, so we force exact matches.
- * (e.g. MySQL folds database and table names to lowercase on Windows
- * by default; but that default can be changed by the
- * 'lower_case_table_names' system variable. This is because databases are
- * stored as directories and tables are stored as files in the underlying
- * O/S; and the case-sensitivity of the names is determined by the behavior
- * of filenames on the O/S. Then, to complicate things,
- * none of the other identifiers, like table and column names, are folded;
- * but they are case-insensitive, unless delimited. See
- * http://dev.mysql.com/doc/refman/6.0/en/identifier-case-sensitivity.html.)
- */
- @Override
- Folder getFolder() {
- return Folder.NONE;
- }
-
- /**
- * MySQL has a single schema with the same name as the database.
- */
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return sc.getDatabase().getName();
- }
-
- /**
- * MySQL is the only vendor that allows a digit.
- * Although, the name cannnot be *all* digits.
- */
- @Override
- boolean characterIsNormalNameStart(char c) {
- return Character.isDigit(c) || super.characterIsNormalNameStart(c);
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_', '$' };
-
- /**
- * By default, MySQL delimits identifiers with backticks (`); but it
- * can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsDelimited(identifier, BACKTICK)
- || super.identifierIsDelimited(identifier);
- }
- private static final char BACKTICK = '`';
-
- }
-
- private static class Oracle extends Vendor {
- static final Vendor INSTANCE = new Oracle();
-
- private Oracle() {
- super();
- }
-
- @Override
- String getName() {
- return "Oracle"; //$NON-NLS-1$
- }
-
- /**
- * Oracle has a single, unnamed catalog that contains all the schemata.
- */
- @Override
- String getDefaultCatalogIdentifier(DTPDatabaseWrapper database) {
- return ""; //$NON-NLS-1$
- }
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_', '$', '#' };
-
- }
-
- private static class Postgres extends Vendor {
- static final Vendor INSTANCE = new Postgres();
-
- private Postgres() {
- super();
- }
-
- @Override
- String getName() {
- return "postgres"; //$NON-NLS-1$
- }
-
- @Override
- Folder getFolder() {
- return Folder.LOWER;
- }
-
- /**
- * PostgreSQL has a single, unnamed catalog that contains all the schemata.
- */
- @Override
- String getDefaultCatalogIdentifier(DTPDatabaseWrapper database) {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * PostgreSQL has a "schema search path". The default is:
- * "$user",public
- * If "$user" is not found, return "public".
- */
- @Override
- DTPSchemaWrapper getDefaultSchema(DTPSchemaContainerWrapper sc) {
- DTPSchemaWrapper schema = super.getDefaultSchema(sc);
- return (schema != null) ? schema : sc.getSchemaNamed(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "public"; //$NON-NLS-1$
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '$' };
-
- }
-
- private static class MaxDB extends Vendor {
- static final Vendor INSTANCE = new MaxDB();
-
- private MaxDB() {
- super();
- }
-
- @Override
- String getName() {
- return "MaxDB"; //$NON-NLS-1$
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '#', '@', '$' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '_' };
-
- }
-
- private static class Sybase extends Vendor {
- static final Vendor ASA = new Sybase("Sybase_ASA"); //$NON-NLS-1$
- static final Vendor ASE = new Sybase("Sybase_ASE"); //$NON-NLS-1$
-
- private final String name;
-
- private Sybase(String name) {
- super();
- this.name = name;
- }
-
- @Override
- String getName() {
- return this.name;
- }
-
- /**
- * The default schema on Sybase for any database (catalog) is 'dbo'.
- */
- @Override
- String getDefaultSchemaIdentifier(DTPSchemaContainerWrapper sc) {
- return DEFAULT_SCHEMA_NAME;
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- /**
- * By default, Sybase identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- @Override
- Folder getFolder() {
- return Folder.NONE;
- }
-
- @Override
- char[] getNormalNameStartCharacters() {
- return NORMAL_NAME_START_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_START_CHARACTERS = new char[] { '_', '@' };
-
- @Override
- char[] getNormalNamePartCharacters() {
- return NORMAL_NAME_PART_CHARACTERS;
- }
- private static final char[] NORMAL_NAME_PART_CHARACTERS = new char[] { '$', '¥', '£', '#' };
-
- /**
- * By default, Sybase delimits identifiers with brackets ([]); but it
- * can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java
deleted file mode 100644
index 8317bb926e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP ForeignKey
- */
-final class DTPForeignKeyWrapper
- extends DTPDatabaseObjectWrapper
- implements ForeignKey
-{
- // the wrapped DTP foreign key
- private final org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey;
-
- // lazy-initialized
- private DTPTableWrapper referencedTable;
-
- // lazy-initialized
- private LocalColumnPair[] columnPairs;
-
- // lazy-initialized - but it can be 'null' so we use a flag
- private String defaultAttributeName;
- private boolean defaultAttributeNameCalculated = false;
-
-
- // ********** constructor **********
-
- DTPForeignKeyWrapper(DTPTableWrapper baseTable, org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey) {
- super(baseTable, dtpForeignKey);
- this.dtpForeignKey = dtpForeignKey;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().foreignKeyChanged(this);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName() + ": " + Arrays.asList(this.getColumnPairs())); //$NON-NLS-1$
- }
-
-
- // ********** ForeignKey implementation **********
-
- public String getName() {
- return this.dtpForeignKey.getName();
- }
-
- public DTPTableWrapper getBaseTable() {
- return (DTPTableWrapper) this.getParent();
- }
-
- public synchronized DTPTableWrapper getReferencedTable() {
- if (this.referencedTable == null) {
- this.referencedTable = this.getBaseTable().getTable(this.dtpForeignKey.getUniqueConstraint().getBaseTable());
- }
- return this.referencedTable;
- }
-
- public boolean referencesSingleColumnPrimaryKey() {
- if (this.columnPairsSize() != 1) {
- return false;
- }
- if (this.getReferencedTable().primaryKeyColumnsSize() != 1) {
- return false;
- }
- return this.getColumnPair().getReferencedColumn() == this.getReferencedTable().getPrimaryKeyColumn();
- }
-
- // ***** column pairs
-
- public Iterator<ColumnPair> columnPairs() {
- return new ArrayIterator<ColumnPair>(this.getColumnPairs());
- }
-
- public LocalColumnPair getColumnPair() {
- LocalColumnPair[] pairs = this.getColumnPairs();
- if (pairs.length != 1) {
- throw new IllegalStateException("multiple column pairs: " + pairs.length); //$NON-NLS-1$
- }
- return pairs[0];
- }
-
- private Iterator<LocalColumnPair> localColumnPairs() {
- return new ArrayIterator<LocalColumnPair>(this.getColumnPairs());
- }
-
- private synchronized LocalColumnPair[] getColumnPairs() {
- if (this.columnPairs == null) {
- this.columnPairs = this.buildColumnPairs();
- }
- return this.columnPairs;
- }
-
- private LocalColumnPair[] buildColumnPairs() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> baseColumns = this.getDTPBaseColumns();
- int size = baseColumns.size();
- List<org.eclipse.datatools.modelbase.sql.tables.Column> refColumns = this.getDTPReferenceColumns();
- if (refColumns.size() != size) {
- throw new IllegalStateException(this.getBaseTable().getName() + '.' + this.getName() +
- " - mismatched sizes: " + size + " vs. " + refColumns.size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- LocalColumnPair[] result = new LocalColumnPair[baseColumns.size()];
- for (int i = baseColumns.size(); i-- > 0; ) {
- result[i] = new LocalColumnPair(
- this.getBaseTable().getColumn(baseColumns.get(i)),
- this.getBaseTable().getColumn(refColumns.get(i))
- );
- }
- return result;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPBaseColumns() {
- return this.dtpForeignKey.getMembers();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPReferenceColumns() {
- return this.dtpForeignKey.getUniqueConstraint().getMembers();
- }
-
- public int columnPairsSize() {
- return this.getColumnPairs().length;
- }
-
- public Iterator<Column> baseColumns() {
- return new TransformationIterator<LocalColumnPair, Column>(this.localColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair pair) {
- return pair.getBaseColumn();
- }
- };
- }
-
- boolean baseColumnsContains(Column column) {
- return CollectionTools.contains(this.baseColumns(), column);
- }
-
- public Iterator<Column> nonPrimaryKeyBaseColumns() {
- return new FilteringIterator<Column, Column>(this.baseColumns()) {
- @Override
- protected boolean accept(Column column) {
- return ! column.isPrimaryKeyColumn();
- }
- };
- }
-
- public Iterator<Column> referencedColumns() {
- return new TransformationIterator<LocalColumnPair, Column>(this.localColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair columnPair) {
- return columnPair.getReferencedColumn();
- }
- };
- }
-
- // ***** attribute name
-
- public String getAttributeName() {
- String defaultName = this.getDefaultAttributeName();
- return (defaultName != null) ? defaultName : this.getNonDefaultAttributeName();
- }
-
- public synchronized String getDefaultAttributeName() {
- if ( ! this.defaultAttributeNameCalculated) {
- this.defaultAttributeNameCalculated = true;
- this.defaultAttributeName = this.buildDefaultAttributeName();
- }
- return this.defaultAttributeName;
- }
-
- private String buildDefaultAttributeName() {
- if ( ! this.referencesSingleColumnPrimaryKey()) {
- return null;
- }
- LocalColumnPair columnPair = this.getColumnPair();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- if (baseColName.length() <= (refColName.length() + 1)) {
- return null;
- }
- if ( ! baseColName.endsWith(refColName)) {
- return null;
- }
- int _index = baseColName.length() - refColName.length() - 1;
- if (baseColName.charAt(_index) != '_') {
- return null;
- }
- return baseColName.substring(0, _index);
- }
-
- /**
- * If this is a simple (single-column) foreign key, use the name of the
- * single base column to build a name. If this is a compound foreign key,
- * return the name of the referenced table.
- */
- // TODO if there is only one FK to a given table, use the table's name instead of the column's name?
- private String getNonDefaultAttributeName() {
- return (this.columnPairsSize() == 1) ?
- this.getNonDefaultAttributeNameFromBaseColumn()
- :
- this.getReferencedTable().getName();
- }
-
- /**
- * The underscore check is helpful when the referenced column is NOT the
- * primary key of the referenced table (i.e. it has only a UNIQUE constraint).
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLEID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLE_PK => CUBICLE.ID) => "CUBICLE_PK"
- */
- private String getNonDefaultAttributeNameFromBaseColumn() {
- LocalColumnPair columnPair = this.getColumnPair();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- int len = baseColName.length();
- int refLen = refColName.length();
- if ((len > refLen) && baseColName.endsWith(refColName)) {
- len = len - refLen;
- if ((len > 1) && baseColName.charAt(len - 1) == '_') {
- len = len - 1;
- }
- }
- return baseColName.substring(0, len);
- }
-
- /**
- * Examples:
- * Oracle etc.
- * ForeignKey(FOO_ID => ID) vs. "foo" => null
- * ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- *
- * PostgreSQL etc.
- * ForeignKey(foo_id => id) vs. "foo" => null
- * ForeignKey(foo_id => foo_id) vs. "foo" => "foo_id"
- * ForeignKey(foo => id) vs. "foo" => "foo"
- * ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- *
- * SQL Server etc.
- * ForeignKey(foo_ID => ID) vs. "foo" => null
- * ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * ForeignKey(Foo_ID => ID) vs. "foo" => "Foo_ID"
- */
- public String getJoinColumnAnnotationIdentifier(String attributeName) {
- String baseColumnName = this.getColumnPair().getBaseColumn().getName();
- String defaultBaseColumnName = attributeName + '_' + this.getReferencedTable().getPrimaryKeyColumn().getName();
- return this.getDatabase().convertNameToIdentifier(baseColumnName, defaultBaseColumnName);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(ForeignKey foreignKey) {
- return Collator.getInstance().compare(this.getName(), foreignKey.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.constraints.ForeignKey foreignKey) {
- return this.dtpForeignKey == foreignKey;
- }
-
- @Override
- void clear() {
- // the foreign key does not "contain" any other objects,
- // so we don't need to forward the #clear()
- this.defaultAttributeNameCalculated = false;
- this.defaultAttributeName = null;
- this.columnPairs = null;
- this.referencedTable = null;
- }
-
-
- // ********** column pair implementation **********
-
- private static class LocalColumnPair implements ColumnPair {
- private final DTPColumnWrapper baseColumn;
- private final DTPColumnWrapper referencedColumn;
-
- LocalColumnPair(DTPColumnWrapper baseColumn, DTPColumnWrapper referencedColumn) {
- super();
- if ((baseColumn == null) || (referencedColumn == null)) {
- throw new NullPointerException();
- }
- this.baseColumn = baseColumn;
- this.referencedColumn = referencedColumn;
- }
-
- public DTPColumnWrapper getBaseColumn() {
- return this.baseColumn;
- }
-
- public DTPColumnWrapper getReferencedColumn() {
- return this.referencedColumn;
- }
-
- public int compareTo(ColumnPair columnPair) {
- return Collator.getInstance().compare(this.getBaseColumn().getName(), columnPair.getBaseColumn().getName());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.baseColumn.getName() + "=>" + this.referencedColumn.getName()); //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java
deleted file mode 100644
index 3ac1595aee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Coalesce behavior for a schema container (i.e. database or catalog).
- */
-abstract class DTPSchemaContainerWrapper
- extends DTPDatabaseObjectWrapper
- implements SchemaContainer
-{
- // lazy-initialized
- private DTPSchemaWrapper[] schemata;
-
-
- // ********** constructor **********
-
- DTPSchemaContainerWrapper(DTPDatabaseObject parent, Object dtpObject) {
- super(parent, dtpObject);
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- }
-
-
- // ********** abstract methods **********
-
- /**
- * return the schema container's DTP schemata
- */
- abstract List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemata();
-
- /**
- * return the schema for the specified DTP schema
- */
- abstract DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema);
-
- /**
- * assume the schema container (database or catalog) contains
- * the specified schema
- */
- DTPSchemaWrapper getSchema_(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- for (DTPSchemaWrapper schema : this.getSchemata()) {
- if (schema.wraps(dtpSchema)) {
- return schema;
- }
- }
- throw new IllegalArgumentException("invalid DTP schema: " + dtpSchema); //$NON-NLS-1$
- }
-
- /**
- * return the table for the specified DTP table
- */
- abstract DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable);
-
- /**
- * assume the schema container contains the specified table
- */
- DTPTableWrapper getTable_(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getSchema_(dtpTable.getSchema()).getTable_(dtpTable);
- }
-
- /**
- * return the column for the specified DTP column
- */
- abstract DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn);
-
- /**
- * assume the schema container contains the specified column
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getTable_(dtpColumn.getTable()).getColumn_(dtpColumn);
- }
-
-
- // ********** schemata **********
-
- public Iterator<Schema> schemata() {
- return new ArrayIterator<Schema>(this.getSchemata());
- }
-
- Iterator<DTPSchemaWrapper> schemaWrappers() {
- return new ArrayIterator<DTPSchemaWrapper>(this.getSchemata());
- }
-
- synchronized DTPSchemaWrapper[] getSchemata() {
- if (this.schemata == null) {
- this.schemata = this.buildSchemata();
- }
- return this.schemata;
- }
-
- private DTPSchemaWrapper[] buildSchemata() {
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.getDTPSchemata();
- DTPSchemaWrapper[] result = new DTPSchemaWrapper[dtpSchemata.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPSchemaWrapper(this, dtpSchemata.get(i));
- }
- return CollectionTools.sort(result);
- }
-
- public int schemataSize() {
- return this.getSchemata().length;
- }
-
- public DTPSchemaWrapper getSchemaNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSchemata(), name);
- }
-
- public Iterator<String> sortedSchemaIdentifiers() {
- // the schemata are already sorted
- return new TransformationIterator<DTPSchemaWrapper, String>(this.schemaWrappers()) {
- @Override
- protected String transform(DTPSchemaWrapper next) {
- return next.getIdentifier();
- }
- };
- }
-
- public DTPSchemaWrapper getSchemaForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getSchemata(), identifier);
- }
-
- public DTPSchemaWrapper getDefaultSchema() {
- return this.getDatabase().getDefaultSchema(this);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.schemata != null) {
- this.startSchemata();
- }
- super.startListening();
- }
-
- private void startSchemata() {
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.schemata != null) {
- this.stopSchemata();
- }
- super.stopListening();
- }
-
- private void stopSchemata() {
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.schemata != null) {
- this.clearSchemata();
- }
- }
-
- private void clearSchemata() {
- this.stopSchemata();
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.clear();
- }
- this.schemata = null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java
deleted file mode 100644
index 08382c69d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Sequence;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP Schema
- */
-final class DTPSchemaWrapper
- extends DTPDatabaseObjectWrapper
- implements Schema
-{
- // the wrapped DTP schema
- private final org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema;
-
- // lazy-initialized
- private DTPTableWrapper[] tables;
-
- // lazy-initialized
- private DTPSequenceWrapper[] sequences;
-
-
- // ********** constructor **********
-
- DTPSchemaWrapper(DTPSchemaContainerWrapper container, org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- super(container, dtpSchema);
- this.dtpSchema = dtpSchema;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().schemaChanged(this);
- }
-
-
- // ********** Schema implementation **********
-
- public String getName() {
- return this.dtpSchema.getName();
- }
-
- public DTPSchemaContainerWrapper getContainer() {
- return (DTPSchemaContainerWrapper) this.getParent();
- }
-
- // ***** tables
-
- public Iterator<Table> tables() {
- return new ArrayIterator<Table>(this.getTables());
- }
-
- private Iterator<DTPTableWrapper> tableWrappers() {
- return new ArrayIterator<DTPTableWrapper>(this.getTables());
- }
-
- private synchronized DTPTableWrapper[] getTables() {
- if (this.tables == null) {
- this.tables = this.buildTables();
- }
- return this.tables;
- }
-
- private DTPTableWrapper[] buildTables() {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables = this.getDTPTables();
- DTPTableWrapper[] result = new DTPTableWrapper[dtpTables.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPTableWrapper(this, dtpTables.get(i));
- }
- return CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables() {
- return this.dtpSchema.getTables();
- }
-
- public int tablesSize() {
- return this.getTables().length;
- }
-
- /**
- * return the table for the specified DTP table
- */
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- // try to short-circuit the search
- return this.wraps(dtpTable.getSchema()) ?
- this.getTable_(dtpTable)
- :
- this.getContainer().getTable(dtpTable);
- }
-
- /**
- * assume the schema contains the specified table
- */
- DTPTableWrapper getTable_(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- for (DTPTableWrapper table : this.getTables()) {
- if (table.wraps(dtpTable)) {
- return table;
- }
- }
- throw new IllegalArgumentException("invalid DTP table: " + dtpTable); //$NON-NLS-1$
- }
-
- public DTPTableWrapper getTableNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getTables(), name);
- }
-
- public Iterator<String> sortedTableIdentifiers() {
- // the tables are already sorted
- return new TransformationIterator<DTPTableWrapper, String>(this.tableWrappers()) {
- @Override
- protected String transform(DTPTableWrapper table) {
- return table.getIdentifier();
- }
- };
- }
-
- public DTPTableWrapper getTableForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getTables(), identifier);
- }
-
- // ***** sequences
-
- public Iterator<Sequence> sequences() {
- return new ArrayIterator<Sequence>(this.getSequences());
- }
-
- private Iterator<DTPSequenceWrapper> sequenceWrappers() {
- return new ArrayIterator<DTPSequenceWrapper>(this.getSequences());
- }
-
- private synchronized DTPSequenceWrapper[] getSequences() {
- if (this.sequences == null) {
- this.sequences = this.buildSequences();
- }
- return this.sequences;
- }
-
- private DTPSequenceWrapper[] buildSequences() {
- List<org.eclipse.datatools.modelbase.sql.schema.Sequence> dtpSequences = this.getDTPSequences();
- DTPSequenceWrapper[] result = new DTPSequenceWrapper[dtpSequences.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPSequenceWrapper(this, dtpSequences.get(i));
- }
- return CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.schema.Sequence> getDTPSequences() {
- return this.dtpSchema.getSequences();
- }
-
- public int sequencesSize() {
- return this.getSequences().length;
- }
-
- public DTPSequenceWrapper getSequenceNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSequences(), name);
- }
-
- public Iterator<String> sortedSequenceIdentifiers() {
- // the sequences are already sorted
- return new TransformationIterator<DTPSequenceWrapper, String>(this.sequenceWrappers()) {
- @Override
- protected String transform(DTPSequenceWrapper sequence) {
- return sequence.getIdentifier();
- }
- };
- }
-
- public DTPSequenceWrapper getSequenceForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getSequences(), identifier);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Schema schema) {
- return Collator.getInstance().compare(this.getName(), schema.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Schema schema) {
- return this.dtpSchema == schema;
- }
-
- /**
- * return the column for the specified DTP column
- */
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.wraps(dtpColumn.getTable().getSchema()) ?
- this.getColumn_(dtpColumn)
- :
- this.getContainer().getColumn(dtpColumn);
- }
-
- /**
- * assume the schema contains the specified column
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getTable_(dtpColumn.getTable()).getColumn_(dtpColumn);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.sequences != null) {
- this.startSequences();
- }
- if (this.tables != null) {
- this.startTables();
- }
- super.startListening();
- }
-
- private void startSequences() {
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.startListening();
- }
- }
-
- private void startTables() {
- for (DTPTableWrapper table : this.tables) {
- table.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.sequences != null) {
- this.stopSequences();
- }
- if (this.tables != null) {
- this.stopTables();
- }
- super.stopListening();
- }
-
- private void stopSequences() {
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.stopListening();
- }
- }
-
- private void stopTables() {
- for (DTPTableWrapper table : this.tables) {
- table.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.sequences != null) {
- this.clearSequences();
- }
- if (this.tables != null) {
- this.clearTables();
- }
- }
-
- private void clearSequences() {
- this.stopSequences();
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.clear();
- }
- this.sequences = null;
- }
-
- private void clearTables() {
- this.stopTables();
- for (DTPTableWrapper table : this.tables) {
- table.clear();
- }
- this.tables = null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java
deleted file mode 100644
index aa501051aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-
-import org.eclipse.jpt.db.Sequence;
-
-/**
- * Wrap a DTP Sequence
- */
-final class DTPSequenceWrapper
- extends DTPDatabaseObjectWrapper
- implements Sequence
-{
- // the wrapped DTP sequence
- private final org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence;
-
-
- // ********** constructor **********
-
- DTPSequenceWrapper(DTPSchemaWrapper schema, org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence) {
- super(schema, dtpSequence);
- this.dtpSequence = dtpSequence;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().sequenceChanged(this);
- }
-
-
- // ********** Sequence implementation **********
-
- public String getName() {
- return this.dtpSequence.getName();
- }
-
- public DTPSchemaWrapper getSchema() {
- return (DTPSchemaWrapper) this.getParent();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Sequence sequence) {
- return Collator.getInstance().compare(this.getName(), sequence.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Sequence sequence) {
- return this.dtpSequence == sequence;
- }
-
- @Override
- void clear() {
- // no state to clear
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java
deleted file mode 100644
index 3dab7266df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.constraints.PrimaryKey;
-import org.eclipse.datatools.modelbase.sql.tables.BaseTable;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP Table
- */
-final class DTPTableWrapper
- extends DTPDatabaseObjectWrapper
- implements Table
-{
- // the wrapped DTP table
- private final org.eclipse.datatools.modelbase.sql.tables.Table dtpTable;
-
- // lazy-initialized
- private DTPColumnWrapper[] columns;
-
- // lazy-initialized
- private DTPColumnWrapper[] primaryKeyColumns;
-
- // lazy-initialized
- private DTPForeignKeyWrapper[] foreignKeys;
-
-
- private static final DTPColumnWrapper[] EMPTY_COLUMNS = new DTPColumnWrapper[0];
- private static final DTPForeignKeyWrapper[] EMPTY_FOREIGN_KEYS = new DTPForeignKeyWrapper[0];
-
-
- // ********** constructor **********
-
- DTPTableWrapper(DTPSchemaWrapper schema, org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- super(schema, dtpTable);
- this.dtpTable = dtpTable;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().tableChanged(this);
- }
-
-
- // ********** Table implementation **********
-
- public String getName() {
- return this.dtpTable.getName();
- }
-
- public DTPSchemaWrapper getSchema() {
- return (DTPSchemaWrapper) this.getParent();
- }
-
- // ***** columns
-
- public Iterator<Column> columns() {
- return new ArrayIterator<Column>(this.getColumns());
- }
-
- private Iterator<DTPColumnWrapper> columnWrappers() {
- return new ArrayIterator<DTPColumnWrapper>(this.getColumns());
- }
-
- private synchronized DTPColumnWrapper[] getColumns() {
- if (this.columns == null) {
- this.columns = this.buildColumns();
- }
- return this.columns;
- }
-
- private DTPColumnWrapper[] buildColumns() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> dtpColumns = this.getDTPColumns();
- DTPColumnWrapper[] result = new DTPColumnWrapper[dtpColumns.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPColumnWrapper(this, dtpColumns.get(i));
- }
- return CollectionTools.sort(result);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPColumns() {
- return this.dtpTable.getColumns();
- }
-
- public int columnsSize() {
- return this.getColumns().length;
- }
-
- public DTPColumnWrapper getColumnNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getColumns(), name);
- }
-
- /**
- * return the column for the specified DTP column
- */
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable()) ?
- this.getColumn_(dtpColumn)
- :
- this.getSchema().getColumn(dtpColumn);
- }
-
- /**
- * assume the table contains the specified column
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- for (DTPColumnWrapper column : this.getColumns()) {
- if (column.wraps(dtpColumn)) {
- return column;
- }
- }
- throw new IllegalArgumentException("invalid DTP column: " + dtpColumn); //$NON-NLS-1$
- }
-
- public Iterator<String> sortedColumnIdentifiers() {
- // the columns are already sorted
- return new TransformationIterator<DTPColumnWrapper, String>(this.columnWrappers()) {
- @Override
- protected String transform(DTPColumnWrapper next) {
- return next.getIdentifier();
- }
- };
- }
-
- public DTPColumnWrapper getColumnForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getColumns(), identifier);
- }
-
- // ***** primaryKeyColumns
-
- public Iterator<Column> primaryKeyColumns() {
- return new ArrayIterator<Column>(this.getPrimaryKeyColumns());
- }
-
- public DTPColumnWrapper getPrimaryKeyColumn() {
- DTPColumnWrapper[] pkColumns = this.getPrimaryKeyColumns();
- if (pkColumns.length != 1) {
- throw new IllegalStateException("multiple primary key columns: " + pkColumns.length); //$NON-NLS-1$
- }
- return pkColumns[0];
- }
-
- private synchronized DTPColumnWrapper[] getPrimaryKeyColumns() {
- if (this.primaryKeyColumns == null) {
- this.primaryKeyColumns = this.buildPrimaryKeyColumns();
- }
- return this.primaryKeyColumns;
- }
-
- private DTPColumnWrapper[] buildPrimaryKeyColumns() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return EMPTY_COLUMNS;
- }
- PrimaryKey pk = ((BaseTable) this.dtpTable).getPrimaryKey();
- if (pk == null) {
- // no PK was defined
- return EMPTY_COLUMNS;
- }
- List<org.eclipse.datatools.modelbase.sql.tables.Column> pkColumns = this.getColumns(pk);
- DTPColumnWrapper[] result = new DTPColumnWrapper[pkColumns.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = this.getColumn(pkColumns.get(i));
- }
- return result;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getColumns(PrimaryKey pk) {
- return pk.getMembers();
- }
-
- public int primaryKeyColumnsSize() {
- return this.getPrimaryKeyColumns().length;
- }
-
- boolean primaryKeyColumnsContains(Column column) {
- return CollectionTools.contains(this.getPrimaryKeyColumns(), column);
- }
-
- // ***** foreignKeys
-
- public Iterator<ForeignKey> foreignKeys() {
- return new ArrayIterator<ForeignKey>(this.getForeignKeys());
- }
-
- private synchronized DTPForeignKeyWrapper[] getForeignKeys() {
- if (this.foreignKeys == null) {
- this.foreignKeys = this.buildForeignKeys();
- }
- return this.foreignKeys;
- }
-
- private DTPForeignKeyWrapper[] buildForeignKeys() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return EMPTY_FOREIGN_KEYS;
- }
- List<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> dtpForeignKeys = this.getDTPForeignKeys();
- DTPForeignKeyWrapper[] result = new DTPForeignKeyWrapper[dtpForeignKeys.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPForeignKeyWrapper(this, dtpForeignKeys.get(i));
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> getDTPForeignKeys() {
- return ((BaseTable) this.dtpTable).getForeignKeys();
- }
-
- public int foreignKeysSize() {
- return this.getForeignKeys().length;
- }
-
- /**
- * return whether the specified column is a base column for at least one
- * of the the table's foreign keys
- */
- boolean foreignKeyBaseColumnsContains(Column column) {
- for (DTPForeignKeyWrapper fkWrapper : this.getForeignKeys()) {
- if (fkWrapper.baseColumnsContains(column)) {
- return true;
- }
- }
- return false;
- }
-
- // ***** join table
-
- public boolean isPossibleJoinTable() {
- if (this.getForeignKeys().length != 2) {
- return false; // the table must have exactly 2 foreign keys
- }
- for (Column column : this.getColumns()) {
- if ( ! this.foreignKeyBaseColumnsContains(column)) {
- return false; // all the table's columns must belong to one (or both) of the 2 foreign keys
- }
- }
- return true;
- }
-
- /**
- * If the table name is FOO_BAR and it joins tables FOO and BAR,
- * return the foreign key to FOO;
- * if the table name is BAR_FOO and it joins tables FOO and BAR,
- * return the foreign key to BAR;
- * otherwise simply return the first foreign key in the array.
- */
- public ForeignKey getJoinTableOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeys()[0];
- String name0 = fk0.getReferencedTable().getName();
-
- ForeignKey fk1 = this.getForeignKeys()[1];
- String name1 = fk1.getReferencedTable().getName();
-
- return this.getName().equals(name1 + '_' + name0) ? fk1 : fk0;
- }
-
- public ForeignKey getJoinTableNonOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeys()[0];
- ForeignKey fk1 = this.getForeignKeys()[1];
- ForeignKey ofk = this.getJoinTableOwningForeignKey();
- return (ofk == fk0) ? fk1 : fk0;
- }
-
- /**
- * Hmmm....
- * We might want to go to the platform to allow a vendor-specific
- * comparison here;
- * but, since all the names are coming directly from the database
- * (i.e. there are no conversions to Java identifiers etc.), it seems
- * like we can just compare them directly and ignore case-sensitivity
- * issues.... ~bjv
- */
- public boolean joinTableNameIsDefault() {
- return this.getName().equals(this.buildDefaultJoinTableName());
- }
-
- private String buildDefaultJoinTableName() {
- return this.getJoinTableOwningTable().getName()
- + '_'
- + this.getJoinTableNonOwningTable().getName();
- }
-
- private Table getJoinTableOwningTable() {
- return this.getJoinTableOwningForeignKey().getReferencedTable();
- }
-
- private Table getJoinTableNonOwningTable() {
- return this.getJoinTableNonOwningForeignKey().getReferencedTable();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Table table) {
- return Collator.getInstance().compare(this.getName(), table.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- return this.dtpTable == table;
- }
-
- /**
- * return the table for the specified DTP table
- */
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- // try to short-circuit the search
- return this.wraps(table) ? this : this.getSchema().getTable(table);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.foreignKeys != null) {
- this.startForeignKeys();
- }
- if (this.columns != null) {
- this.startColumns();
- }
- super.startListening();
- }
-
- private void startForeignKeys() {
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.startListening();
- }
- }
-
- private void startColumns() {
- for (DTPColumnWrapper column : this.columns) {
- column.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.foreignKeys != null) {
- this.stopForeignKeys();
- }
- if (this.columns != null) {
- this.stopColumns();
- }
- super.stopListening();
- }
-
- private void stopForeignKeys() {
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.stopListening();
- }
- }
-
- private void stopColumns() {
- for (DTPColumnWrapper column : this.columns) {
- column.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- void clear() {
- if (this.foreignKeys != null) {
- this.clearForeignKeys();
- }
-
- // the table does not "contain" the pk columns, so no need to forward #clear()
- this.primaryKeyColumns = null;
-
- if (this.columns != null) {
- this.clearColumns();
- }
- }
-
- private void clearForeignKeys() {
- this.stopForeignKeys();
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.clear();
- }
- this.foreignKeys = null;
- }
-
- private void clearColumns() {
- this.stopColumns();
- for (DTPColumnWrapper column : this.columns) {
- column.clear();
- }
- this.columns = null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/.project b/jpa/plugins/org.eclipse.jpt.doc.user/.project
deleted file mode 100644
index 61670ff4fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 7f327f0c93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,9 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.doc.user;singleton:=true
-Bundle-Version: 1.0.300.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.help;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.cheatsheets;bundle-version="[3.3.100,4.0.0)"
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm b/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
deleted file mode 100644
index 6c3af6e2fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:55 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>About this content</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref257" name="sthref257"></a>
-<h1>About this content</h1>
-<p>January, 2008</p>
-<a id="sthref258" name="sthref258"></a>
-<p class="subhead2">License</p>
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.html b/jpa/plugins/org.eclipse.jpt.doc.user/about.html
deleted file mode 100644
index 6c3af6e2fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:55 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>About this content</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref257" name="sthref257"></a>
-<h1>About this content</h1>
-<p>January, 2008</p>
-<a id="sthref258" name="sthref258"></a>
-<p class="subhead2">License</p>
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties b/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
deleted file mode 100644
index 4ecd752108..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
+++ /dev/null
@@ -1,115 +0,0 @@
-bin.includes = cheatsheets/,\
- dcommon/,\
- img/,\
- META-INF/,\
- about.html,\
- build.properties,\
- concept_mapping.htm,\
- concept_persistence.htm,\
- concepts.htm,\
- concepts001.htm,\
- concepts002.htm,\
- concepts003.htm,\
- contexts.xml,\
- getting_started.htm,\
- getting_started001.htm,\
- getting_started002.htm,\
- getting_started003.htm,\
- getting_started004.htm,\
- index.xml,\
- legal.htm,\
- plugin.properties,\
- plugin.xml,\
- ref_details_orm.htm,\
- ref_jpa_facet.htm,\
- ref_mapping_general.htm,\
- ref_new_jpa_project.htm,\
- ref_new_jpa_project_wizard.htm,\
- ref_persistence_map_view.htm,\
- ref_persistence_outline.htm,\
- ref_persistence_perspective.htm,\
- ref_persistence_prop_view.htm,\
- ref_primary_key.htm,\
- ref_project_properties.htm,\
- reference.htm,\
- reference001.htm,\
- reference002.htm,\
- reference003.htm,\
- reference004.htm,\
- reference005.htm,\
- reference006.htm,\
- reference007.htm,\
- reference008.htm,\
- reference009.htm,\
- reference010.htm,\
- reference011.htm,\
- reference012.htm,\
- reference013.htm,\
- reference014.htm,\
- reference015.htm,\
- reference016.htm,\
- reference017.htm,\
- reference018.htm,\
- task_add_persistence.htm,\
- task_additonal_tables.htm,\
- task_create_new_project.htm,\
- task_generate_entities.htm,\
- task_inheritance.htm,\
- task_manage_orm.htm,\
- task_manage_persistence.htm,\
- task_mapping.htm,\
- tasks.htm,\
- tasks001.htm,\
- tasks002.htm,\
- tasks003.htm,\
- tasks004.htm,\
- tasks005.htm,\
- tasks006.htm,\
- tasks007.htm,\
- tasks008.htm,\
- tasks009.htm,\
- tasks010.htm,\
- tasks011.htm,\
- tasks012.htm,\
- tasks013.htm,\
- tasks014.htm,\
- tasks015.htm,\
- tasks016.htm,\
- tasks017.htm,\
- tasks018.htm,\
- tasks019.htm,\
- tasks020.htm,\
- tasks021.htm,\
- tasks022.htm,\
- tips_and_tricks.htm,\
- toc.xml,\
- whats_new.htm,\
- whats_new001.htm,\
- whats_new002.htm,\
- whats_new003.htm,\
- about.htm,\
- reference019.htm,\
- reference020.htm,\
- reference021.htm,\
- reference022.htm,\
- reference023.htm,\
- reference024.htm,\
- reference025.htm,\
- reference026.htm,\
- reference027.htm,\
- reference028.htm,\
- reference030.htm,\
- reference029.htm,\
- reference031.htm,\
- reference032.htm,\
- reference033.htm,\
- reference034.htm,\
- tasks023.htm,\
- tasks024.htm,\
- tasks025.htm,\
- whats_new004.htm,\
- whats_new005.htm,\
- whats_new006.htm,\
- whats_new007.htm,\
- whats_new008.htm
-generateSourceBundle=false
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
deleted file mode 100644
index 6dbeedbeca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a JPA Project">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to create a JPA project.
-
-To learn more about using cheat sheets, or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="false" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-On the first page of the wizard, enter a project name and location, select your target runtime, and select a predefined project configuration.
-
-Click <b>Next</b> to display the next page of the wizard.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Select Project Facet" dialog="false" skip="false" href="/org.eclipse.jst.j2ee.doc.user/topics/ph-projects.html">
- <description>
- Use the Project Facet page to select a predefined project configuration or specific specific facets to include in the project.
-
-Click &quot;Next&quot; to display the next page of the wizard.
- </description>
- </item>
- <item title="Specify the JPA Facet" dialog="false" skip="false" href="/org.eclipse.jdt.doc.user/ref_jpa_facet.htm">
- <description>
- Use the JPA Facet page to specify the the vendor-specific JPA platform, the database connection to use, and the specific JPA implementation library.
-
-You can also specify if Dali should create an orm.xml file.
-
-If you do not have an active database connection, click <b>Add Connections</b> to create one.
-
-If you do not have a defined JPA implementation library, click <b>Configure default JPA implementation library</b> or <b>Configure user libraries</b> to define one.
-
-Click <b>Finish</b> to complete the wizard and open the open the project.
- </description>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully created a JPA project. Complete the additional cheat sheets to add Java persistent entities and map those entities to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
deleted file mode 100644
index b64e8afdee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
-This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to add a Java persistent entity to your Java project.
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the <b>Click to Begin</b> button below.
-Let's get started!
- </description>
- </intro>
- <item title="Create a JPA Project" skip="true">
- <description>
-To create a Persistent entity, you must create a JPA project. If you already have a JPA project, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>File->New->Project...</b> and choose <b>JPA->JPA Project</b> in the list. Complete each page of the Create JPA Project wizard to create a new JPA project.
- </description>
- </item>
- <item title="Open the JPA Development Perspective" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <action pluginId="org.eclipse.ui.cheatsheets" class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" param1="org.eclipse.jpt.ui.PersistencePerspective"/>
- <description>
-When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>Window->Open Perspective->Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the "Click to Perform" button to have the "Persistence" perspective opened automatically.
- </description>
- </item>
- <item title="Create a Java Class">
- <description>
-The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity">
- <description>
-Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the "Map As" field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Finish">
- <description>
-Congratulations! You have successfully added a JPA entity to your JPA project. Complete the additional cheat sheets to map the entity's fields to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
deleted file mode 100644
index 63307f226e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Map a Java Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to map the fields of a JPA entity entity to your database.
-
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-If you already have (and are connected to) a database connection, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-Complete each page of the wizard to create a new JPA project.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
-
-If you already have a JPA project, you may skip this step by clicking the &quot;Click to Skip&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Open the JPA Development Perspective" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <description>
- When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-If not, select <b>Window-&gt;Open Perspective-&gt;Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the &quot;Click to Perform&quot; button to have the &quot;Persistence&quot; perspective opened automatically.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.jpt.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create a Java Class" dialog="false" skip="false">
- <description>
- The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity" dialog="false" skip="false">
- <description>
- Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the &quot;Map As&quot; field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Add Fields to the Class" dialog="false" skip="true">
- <description>
- Now you will add some fields to the entity to map to rows in the database table.
-
-If your persistent entity already has fields to map, you may skip this step by clicking the &quot;Click to Skip&quot; button. If not, use the Java editor to add fields to the entity.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create the Mapping" dialog="false" skip="false" href="/org.eclipse.dali.doc.user/ref_entity_page.htm">
- <description>
- Now you are ready to map the entity fields to columns in the database table. In the Package Explorer, select the Java class.
-
-In the JPA Structure view, expand the persistent entity to display the fields. Select a field.
-
-The JPA Details view displays the information for the field. Use the Map As field to select the Basic mapping. Use the Column field to select a column from the database table.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully mapped the fields from a Java persistent entity to a column in a database table.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
deleted file mode 100644
index 4063527779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Understanding OR mappings</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding OR mappings" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBDJFI" name="BABBDJFI"></a></p>
-<div class="sect1">
-<h1>Understanding OR mappings</h1>
-<p><a id="sthref20" name="sthref20"></a><a id="sthref21" name="sthref21"></a>The Dali OR (object-relational) Mapping Tool allows you to describe how your entity objects <span class="italic">map</span> to the data source (or other objects). This approach isolates persistence information from the object model&ndash;developers are free to design their ideal object model, and DBAs are free to design their ideal schema.</p>
-<p>These mappings transform an object data member type to a corresponding relational database data source representation. These OR mappings can also transform object data members that reference other domain objects stored in other tables in the database and are related through foreign keys.</p>
-<p>You can use these mappings to map simple data types including primitives (such as <code>int</code>), JDK classes (such as <code>String</code>), and large object (LOB) values. You can also use them to transform object data members that reference other domain objects by way of association where data source representations require object identity maintenance (such as sequencing and back references) and possess various types of multiplicity and navigability. The appropriate mapping class is chosen primarily by the cardinality of the relationship.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
deleted file mode 100644
index d1fc4cdf05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Understanding Java persistence</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding Java persistence" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCAHIC" name="BABCAHIC"></a></p>
-<div class="sect1">
-<h1>Understanding Java persistence</h1>
-<p><a id="sthref18" name="sthref18"></a><span class="italic">Persistence</span> refers to the ability to store objects in a database and use those objects with transactional integrity. In a J2EE application, data is typically stored and persisted in the data tier, in a relational database.</p>
-<p><a id="sthref19" name="sthref19"></a><span class="italic">Entity beans</span> are enterprise beans that contain persistent data and that can be saved in various persistent data stores. The entity beans represent data from a database; each entity bean carries its own identity. Entity beans can be deployed using <span class="italic">application-managed persistence</span> or <span class="italic">container-managed persistence</span>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
deleted file mode 100644
index 3663d63540..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Concepts</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Concepts" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref17" name="sthref17"></a></p>
-<h1>Concepts</h1>
-<p>This section contains an overview of concepts you should be familiar with when using Dali to create mappings for Java persistent entities.</p>
-<ul>
-<li>
-<p><a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></p>
-</li>
-<li>
-<p><a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a></p>
-</li>
-<li>
-<p><a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></p>
-</li>
-</ul>
-<p>In addition to these sections, you should review the following resources for additional information:</p>
-<ul>
-<li>
-<p>Eclipse Dali project: <code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code></p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform project: <code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code></p>
-</li>
-<li>
-<p>JSR 220 EJB 3.0 specification: <code><a href="http://www.jcp.org/en/jsr/detail?id=220">http://www.jcp.org/en/jsr/detail?id=220</a></code></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
deleted file mode 100644
index 6a411500ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Understanding EJB 3.0 Java Persistence API</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding EJB 3.0 Java Persistence API" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBGFJG" name="BABBGFJG"></a></p>
-<div class="sect1">
-<h1>Understanding EJB 3.0 Java Persistence API</h1>
-<p>The Java 2 Enterprise Edition(J2EE) Enterprise JavaBeans (EJB) are a component architecture that you use to develop and deploy object-oriented, distributed, enterprise-scale applications. An application written according to the Enterprise JavaBeans architecture is scalable, transactional, and secure.</p>
-<p>The EJB 3.0 Java Persistence API (JPA) improves the EJB architecture by reducing its complexity through the use of metadata (annotations) and specifying programmatic defaults of that metadata.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
deleted file mode 100644
index f4751603c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>The persistence.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The persistence.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHAGIH" name="CHDHAGIH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref22" name="sthref22"></a>The persistence.xml file</h1>
-<p>The JPA specification requires the use of a <code>persistence.xml</code> file for deployment. This file defines the database and entity manager options, and may contain more than one persistence unit. To enable you to easily edit this information, Dali provides the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>. Alternatively, you can use the Eclipse XML Editor to create and maintain this information. See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-To work with multiple persistence units, comment out all but one persistence unit in <code>persistence.xml</code>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
deleted file mode 100644
index 43fff9a255..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>The orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The orm.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDBIJAC" name="CHDBIJAC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref23" name="sthref23"></a>The orm.xml file</h1>
-<p>Although the JPA specification emphasizes the use of annotations to specify persistence, you can also use the <code>orm.xml</code> file to store this metadata. Dali enables you to create a stub <code>orm.xml</code> file for a JPA project using the <a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>. See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The metadata must match the XSD specification of your selected JPA implementation.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>Dali provides comprehensive support for configuring XML mapping files through the <a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a> that is nearly identical to the annotation-based configuration in the Java source. Alternatively, you can also use the Eclipse XML Editor to create and maintain the metadata information in <code>orm.xml</code>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Dali works exclusively with XML mapping files named <code>orm.xml</code>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a><br />
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml b/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
deleted file mode 100644
index 34de0ef6d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
+++ /dev/null
@@ -1,422 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.contexts"?>
-<contexts>
- <context id="entity_accessType">
- <description>Specify how the variable is accessed: Property (default) or Field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_name">
- <description>The name of this entity. By default, the class name is used as the entity name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_table">
- <description>The database table assigned to this entity. By default, the class name is used as the database table name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverrides">
- <description>Specify a property or field to be overridden (from the default mappings).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesName">
- <description>Name of the database column.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesColumn">
- <description>The database column that overrides a property or field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="mapping_mapAs">
- <description>Specify how this attribute maps to the database.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_column">
- <description>The database column that contains the value for the attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnTable">
- <description>Name of the database table that contains the selected column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_fetchType">
- <description>Defines how data is loaded from the database: Eager (default) or Lazy</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_optional">
- <description>Specifies if this field is can be null.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueStrategy">
- <description>Determines how the primary key is generated: Auto (default), Sequence, Identity, or Table.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueGeneratorName">
- <description>Unique name of the generator.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_targetEntity">
- <description>The entity to which this attribute is mapped. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_cascadeType">
- <description>Specify which operations are propagated throughout the entity: All, Persist, Merge, or Move.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_mappedBy">
- <description>The field in the database table that owns the relationship.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinColumnName">
- <description>The name of the database column that contains the foreign key reference for the entity association.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinReferencedColumn">
- <description>Name of the join table that contains the foreign key column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverrides">
- <description>Specify to override the default mapping of an entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverridesColumn">
- <description>The database column that is being mapped to the entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="entity_mapAs">
- <description>Specify the type of persistent domain object for the Java class: Persistent, Embedded, or Mapped Superclass.</description>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_inheritanceStrategy">
- <description>Specify how an entity may inherit properties from other entities: Single table, One table per class, or Joined tables.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorColumn">
- <description>Use to specify the name of the discriminator column when using a Single or Joined inheritance strategy.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorType">
- <description>Use this field to set the discriminator type to CHAR or INTEGER (instead of its default: String). The discriminator value must conform to this type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorValue">
- <description>Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified discriminator type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="mapping_orderBy">
- <description>Specify the default order for objects returned from a query.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an Entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableName">
- <description>Specify the name of the database table that defines the foreign key for a many-to-many or a unidirectional one-to-many association. You can configure the join table with a specific catalog or schema, configure one or more join table columns with a unique constraint, and use multiple join columns per entity.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableJoinColumns">
- <description>Specify two or more join columns (that is, a composite primary key).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableInverseJoinColumns">
- <description>Specify the join column on the owned (or inverse side) of the association: the owned entity's primary key column. </description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="properties_javaPersistence">
- <description>Use the Java Persistence options on the Properties page to select the database connection to use with the project.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceConnection">
- <description>The database connection used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceSchema">
- <description>The database schema used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="dialog_addPersistence">
- <description>Use the Add Persistence dialog to define the database connection use to store the persistence entities.</description>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="persistenceOutline">
- <description>The JPA Structure view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor.</description>
- <topic label="JPA Structure view" href="ref_persistence_outline.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_generateEntities">
- <description>Use the Generate Entities dialog to create Java persistent entities based on your database tables.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm.htm" />
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_generateEntities_source">
- <description>The project folder name in which to generate the Java persistent entities. Click Browse to select an existing folder.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_package">
- <description>The package in which to generate the Java persistent entities, or click Browse to select an existing package.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_tables">
- <description>Select the tables from which to create Java persistent entities.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_addJavaPersistence">
- <description>Use this dialog to define the database connection used to store the persistence entities and to create the persistence.xml file.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="dialog_newJPAProject">
- <description>Use this dialog to define the new JPA project name, its location, target runtime, and other configuration settings.</description>
- <topic label="New JPA Project page" href="ref_new_jpa_project.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_addJavaPersistence_database">
- <description>Use these fields to define the database connection used to store the persistent entities.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_classpath">
- <description>Use this option to add libraries or JARs that contain the Java Persistence API (JPA) and entities to the project’s Java Build Path.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_packaging">
- <description>Use these fields to create the persistence.xml file. Select the persistence version, the name of the JPA provider, and a unique name to identify the persistence unit.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="wizard_generateDDL_options ">
- <description>Use this page to select which script options will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Options page " href="ref_options.htm" />
- </context>
- <context id="wizard_generateDDL_objects ">
- <description>Use this page to select which elements will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Objects page " href="ref_objects.htm" />
- </context>
- <context id="wizard_generateDDL_save ">
- <description>Use this page to select the filename and location of the generated script. You can also preview the script and specify to run or continue editing the script after generation.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Save and Run DDL page " href="ref_save_and_run.htm" />
- </context>
- <context id="wizard_generateDDL_summary ">
- <description>This page shows the settings that you selected for the generated DDL. To change any option click "Back" or click "Finish" to continue.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- </context>
- <context id="mapping_tableGeneratorName">
- <description>The name of the table sequence generator. This name is global to to the persistence unit (across all generator types).</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorTable">
- <description>The database table that stores the generated ID values. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumn">
- <description>The database column of the generator table that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorValueColumn">
- <description>The name for the column that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumnValue">
- <description>The database column of the generator table that defines the primary key value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_databaseAuthorization">
- <description>Use to connect (log in) to a database connection to use with your Java persistent entities.
- You must have a defined database connection (and be connected) to add persistence. </description>
- <topic label="Add persistence to a Java project" href="task_add_persistence_project.htm"/>
- </context>
- <context id="mapping_temporal">
- <description>Specify if the mapped field contains a Date (java.sql.Date), Time (java.sql.Time), or Timestamp (java.sql.Timestamp) value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_primaryKeyGeneration">
- <description>Define how the primary key is generated</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGenerator">
- <description>Specify to use a specific database table for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGenerator">
- <description>Specify to use a specific sequence for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorName">
- <description>Name of the sequence.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorSequence">
- <description> </description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_lob">
- <description>Specify if the field is mapped to java.sql.Clob or java.sql.Blob.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_enumerated">
- <description>Specify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_editInverseJoinColumn">
- <description>.</description>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="entity_catalog">
- <description>The database catalog that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_schema">
- <description>The database schema that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="orm_package">
- <description>The Java package that contains the persistent entities to which the orm.xml file applies.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_schema">
- <description>The database schema to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_catalog">
- <description>The database catalog to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_access">
- <description>The default access method for variables in this project: Property or Field.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_cascade">
- <description>Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_xml">
- <description>Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="dialog_JPAPlatform">
- <description>Specify the vendor-specific JPA implementation.Default is Generic..</description>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
- <context id="dialog_createORM">
- <description>Create an initial orm.xml file. Use this file to specify project and persistence unit defaults.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
-
-
-
-
-</contexts>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
deleted file mode 100644
index baf6127928..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
+++ /dev/null
@@ -1,21 +0,0 @@
-@import "../../../PRODUCT_PLUGIN/book.css";
-
-span.control, span.gui-object-action, p.subhead2, span.bold, p.notep1 {
- font-weight: bold;
-}
-
-span.name, p.titleinfigure, span.italic {
- font-style: italic;
-}
-
-p.titleinfigure, p.subhead2 {
- padding-top: 10px;
-}
-
-span.code {
- font-family: monospace;
-}
-
-span.copyrightlogo {font-size: 0.8em}
-
-.footer {margin-top: 2em;border-top:1px solid #cccccc;padding-top:1em;} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
deleted file mode 100644
index 382ec67619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
-<!-- <meta http-equiv="refresh" content="0;url=../../legal.htm"> -->
-</head>
-<body>
-<p><a href="../../legal.htm">License Information</a></p>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
deleted file mode 100644
index c56c8c0a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Getting started</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Getting started" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref2" name="sthref2"></a></p>
-<h1>Getting started</h1>
-<p>This section provides information on getting started with the Java Persistence Tools.</p>
-<ul>
-<li>
-<p><a href="getting_started001.htm#BABEFHCD">Requirements and installation</a></p>
-</li>
-<li>
-<p><a href="getting_started002.htm#BABIGCJA">Dali quick start</a></p>
-</li>
-</ul>
-<p>For additional information, please visit the Dali home page at:</p>
-<p><code><a href="http://www.eclipse.org/webtools/dali/main.php">http://www.eclipse.org/webtools/dali/main.php</a></code>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
deleted file mode 100644
index 0236f26b15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Requirements and installation</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Requirements and installation" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEFHCD" name="BABEFHCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Requirements and installation<a id="sthref3" name="sthref3"></a><a id="sthref4" name="sthref4"></a></h1>
-<p>Before installing Dali, ensure that your environment meets the following <span class="italic">minimum</span> requirements:</p>
-<ul>
-<li>
-<p>Eclipse 3.4 (<code><a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a></code>)</p>
-</li>
-<li>
-<p>Java Runtime Environment (JRE) 1.5 (<code><a href="http://java.com">http://java.com</a></code>)</p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform (WTP) 3.0 (<code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code>)</p>
-</li>
-<li>
-<p>Java Persistence API (JPA) for Java EE 5. The reference implementation can be obtained from:</p>
-</li>
-</ul>
-<pre xml:space="preserve" class="oac_no_warn">
-<code><a href="https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html">https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html</a></code>
-</pre>
-<p>Refer to <code><a href="http://www.eclipse.org/webtools/dali/gettingstarted_main.html">http://www.eclipse.org/webtools/dali/gettingstarted_main.html</a></code> for additional installation information.</p>
-<p>Dali is included as part of WTP 2.0. No additional installation or configuration is required.</p>
-<a id="sthref5" name="sthref5"></a>
-<p class="subhead2">Accessibility Features</p>
-<p>Dali supports the standard accessibility features in Eclipse, including the following:</p>
-<ul>
-<li>
-<p>Navigating the user interface using the keyboard.</p>
-</li>
-<li>
-<p>Specifying general accessibility preferences for the editor.</p>
-</li>
-</ul>
-<p>See <a href="../org.eclipse.platform.doc.user/concepts/accessibility/accessmain.htm">Accessibility Features in Eclipse</a> in the <span class="italic">Workbench User Guide</span> for details.</p>
-<a id="sthref6" name="sthref6"></a>
-<p class="subhead2">Help Accessibility</p>
-<p>The documentation and help contains markup to facilitate access by the disabled community. See <a href="../org.eclipse.platform.doc.user/tasks/help_accessibility.htm">Help Accessibility</a> in the <span class="italic">Workbench User Guide</span> for details.</p>
-<p>When using the help, be aware of the following:</p>
-<ul>
-<li>
-<p>Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.</p>
-</li>
-<li>
-<p>This documentation may contain links to Web sites of other companies or organizations that we do not control. We neither evaluate nor make any representations regarding the accessibility of these Web sites.</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
deleted file mode 100644
index 9d7f54c7cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Dali quick start</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali quick start" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIGCJA" name="BABIGCJA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dali quick start</h1>
-<p><a id="sthref7" name="sthref7"></a>This section includes information to help you quickly start using Dali to create relational mappings between Java persistent entities and database tables.</p>
-<ul>
-<li>
-<p><a href="getting_started003.htm#BABDFHDA">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity with persistent fields</a></p>
-</li>
-</ul>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="tips_and_tricks.htm#CHDHGHBF">Tips and tricks</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
deleted file mode 100644
index 41907c16c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a new JPA project</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDFHDA" name="BABDFHDA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref8" name="sthref8"></a>This quick start shows how to create a new JPA project.</p>
-<ol start="1">
-<li>
-<p><span class="bold">Select File &gt; New &gt; Project</span>. The Select a Wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also select the JPA perspective and then select <span class="bold">File &gt; New &gt; JPA Project</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-<li>
-<p>Select <span class="bold">JPA Project</span> and then click <span class="bold">Next</span>. The <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> appears.</p>
-</li>
-<li>
-<p>Enter a <span class="gui-object-action">Project name</span> (such as <code>QuickStart</code>).</p>
-</li>
-<li>
-<p>If needed, select the <span class="bold">Target Runtime</span> (such as <code>Apache Tomcat</code>) and configuration, such as <span class="bold">Utility JPA Project with Java 5.0</span> and then click <span class="bold">Next</span>. The <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Target Runtime is not required for Java SE development.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>On the JPA Facet dialog, select your vendor-specific JPA platform (or select <span class="bold">Generic</span>), database connection (or create a new connection), JPA implementation library (such as EclipseLink), define how Dali should manage persistent classes, and then click <span class="bold">Finish</span>.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-Select <span class="bold">Override the Default Schema for Connection</span> if you require a schema other than the one that Dali derives from the connection information, which may be incorrect in some cases. Using this option, you can select a development time schema for defaults and validation.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-</ol>
-<p>Eclipse adds the project to the workbench and opens the JPA perspective.</p>
-<div class="figure"><a id="sthref9" name="sthref9"></a>
-<p class="titleinfigure">Project in Package Explorer</p>
-<img src="img/quickstart_project.png" alt="Package Explorer showing the JPA project." title="Package Explorer showing the JPA project." /><br /></div>
-<!-- class="figure" -->
-<p>Now that you have created a project with persistence, you can continue with <a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity with persistent fields</a>.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
deleted file mode 100644
index e5c2f19db4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
+++ /dev/null
@@ -1,200 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:41 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a Java persistent entity with persistent fields</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a Java persistent entity with persistent fields" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFGDDG" name="BABFGDDG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a Java persistent entity with persistent fields</h1>
-<p><a id="sthref10" name="sthref10"></a>This quick start shows how to create a new persistent Java entity. We will create an entity to associate with a database table. You will also need to add the ADDRESS table to your database.</p>
-<ol start="1">
-<li>
-<p>Select the JPA project in the Navigator or Package Explorer and then click <span class="bold">New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-</li>
-<li>
-<p>Select <span class="bold">Entity</span> and then click <span class="bold">Next</span>. The Entity Class page appears.</p>
-</li>
-<li>
-<p>Enter the package name (such as <code>quickstart.demo.model</code>), the class name (such as <code>Address</code>) and then click <span class="bold">Next</span>. The <a href="reference004.htm#CIADECIA">Entity Properties page</a> appears, which enables you to define the persistence fields, which you will map to the columns of a database table.</p>
-</li>
-<li>
-<p><a id="sthref11" name="sthref11"></a><a id="sthref12" name="sthref12"></a>Use the Entity Fields dialog (invoked by clicking <span class="bold">Add</span>) to add persistence fields to the Address class:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private Long id;
-private String city;
-private String country;
-private String stateOrProvince;
-private String postalCode;
-private String street;
-</pre>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-You will also need to add the following columns to the ADDRESS database table:
-<pre xml:space="preserve" class="oac_no_warn">
-NUMBER(10,0) ADDRESS_ID (primary key)
-VARCHAR2(80) PROVINCE
-VARCHAR2(80) COUNTRY
-VARCHAR2(20) P_CODE
-VARCHAR2(80) STREET
-VARCHAR2(80) CITY
-</pre>
-<pre xml:space="preserve" class="oac_no_warn">
-</pre></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. With the Create JPA Entity completed, Eclipse displays the <span class="bold">Address</span> entity in the JPA Structure view.</p>
-<p>Address.java includes the <code>@Entity</code> annotation, the persistence fields, as well as <code>getter</code> and <code>setter</code> methods for each of the fields.</p>
-</li>
-</ol>
-<div class="figure"><a id="sthref13" name="sthref13"></a>
-<p class="titleinfigure">Address Entity in Address.java</p>
-<img src="img/java_editor_address.png" alt="Java editor with the Address entity." title="Java editor with the Address entity." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse also displays the <span class="bold">Address</span> entity in the JPA Structure view:</p>
-<div class="figure"><a id="sthref14" name="sthref14"></a>
-<p class="titleinfigure">Address Entity in the JPA Structure View</p>
-<img src="img/address_java_JPA_structure_quickstart.png" alt="Address.java in the JPA Structure View." title="Address.java in the JPA Structure View." /><br /></div>
-<!-- class="figure" -->
-<ol start="1">
-<li>
-<p>Select the <span class="gui-object-action">Address</span> class in the Package Explorer view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, notice that Dali has automatically associated the ADDRESS database table with the entity because they are named identically.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Depending on your database connection type, you may need to specify the <span class="bold">Schema</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref15" name="sthref15"></a>
-<p class="titleinfigure">JPA Details View for Address Entity</p>
-<img src="img/address.java_jpa_details.png" alt="Address.java in the JPA Details view." title="Address.java in the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-After associating the entity with the database table, you should update the <code>persistence.xml</code> file to include this JPA entity.
-<p>Right-click the <code>persistence.xml</code> file in the Package Explorer and select <span class="bold">JPA Tools &gt; Synchronize Classes</span>. Dali adds the following to the <code>persistence.xml</code> file:</p>
-<p><code>&lt;class&gt;quickstart.demo.model.Address&lt;/class&gt;</code></p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<p>Now we are ready to map each fields in the Address class to a column in the database table.</p>
-<ol start="1">
-<li>
-<p>Select the <span class="gui-object-action">id</span> field in the JPA Details view.</p>
-</li>
-<li>
-<p>Right click id and then select <span class="bold">Map As &gt; id</span>.</p>
-</li>
-<li>
-<p>In the JPA Details view, select <span class="bold">ADDRESS_ID</span> in the Name field:</p>
-<div class="figure"><a id="sthref16" name="sthref16"></a>
-<p class="titleinfigure">JPA Details View for the addressId Field</p>
-<img src="img/address_id_details_quickstart.png" alt="The JPA Details view for the Address entity&rsquo;s id attribute." title="The JPA Details view for the Address entity&rsquo;s id attribute." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse adds the following annotations to the Address entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="ADDRESS_ID")
-</pre></li>
-<li>
-<p>Map each of the following fields (as <span class="bold">Basic</span> mappings) to the appropriate database column:</p>
-<div class="inftblhruleinformal">
-<table class="HRuleInformal" title="This table describes the mappings for each of the fields in the Address entity." summary="This table describes the mappings for each of the fields in the Address entity." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Field</th>
-<th align="left" valign="bottom" id="r1c2-t8">Map As</th>
-<th align="left" valign="bottom" id="r1c3-t8">Database Column</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">city</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r2c1-t8 r1c3-t8">CITY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">country</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r3c1-t8 r1c3-t8">COUNTRY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">postalCode</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r4c1-t8 r1c3-t8">P_CODE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8">provinceOrState</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r5c1-t8 r1c3-t8">PROVINCE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">street</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r6c1-t8 r1c3-t8">STREET</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformal" --></li>
-</ol>
-<p>Dali automatically maps some fields to the correct database column (such as the city field to the City column) if the names are identical.</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png
deleted file mode 100644
index ed27a5ce29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png
deleted file mode 100644
index 7ef40cf6c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png
deleted file mode 100644
index 1af51a9f9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/change_connection_profile.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/change_connection_profile.png
deleted file mode 100644
index 46ab05e0aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/change_connection_profile.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.png
deleted file mode 100644
index 8716e8b33c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/column_support_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.png
deleted file mode 100644
index 91cda6e6a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/convert_java_project_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.png
deleted file mode 100644
index 69c78a5ffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png
deleted file mode 100644
index f2c0a6c6ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png
deleted file mode 100644
index 52a7fab8db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
deleted file mode 100644
index 5bd48850fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.png
deleted file mode 100644
index 98ec0ac5b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/entering_query_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
deleted file mode 100644
index 3a4964632c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
deleted file mode 100644
index e3cb22b69a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
deleted file mode 100644
index 22b6875f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
deleted file mode 100644
index 3146482609..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
deleted file mode 100644
index a9d721fcc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
deleted file mode 100644
index ff7eaa63b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png
deleted file mode 100644
index 30550ea033..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png
deleted file mode 100644
index d264d09639..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png
deleted file mode 100644
index 3355741af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png
deleted file mode 100644
index fb3d1b263f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png
deleted file mode 100644
index 7a653db355..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png
deleted file mode 100644
index 6ef54378f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png
deleted file mode 100644
index 1b0b7ff4bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png
deleted file mode 100644
index 48294edaf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png
deleted file mode 100644
index abe9dc8d20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png
deleted file mode 100644
index 44d52b8bc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png
deleted file mode 100644
index fdefb5d781..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png
deleted file mode 100644
index eb8022e16c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png
deleted file mode 100644
index ccacc19f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png
deleted file mode 100644
index 398ea2c11f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png
deleted file mode 100644
index fc97ceb1fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png
deleted file mode 100644
index 5ddc989dfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png
deleted file mode 100644
index 74d9bbd66c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png
deleted file mode 100644
index 750488f49d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png
deleted file mode 100644
index a87371215b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png
deleted file mode 100644
index d7ffcdcad9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png
deleted file mode 100644
index 07425ad08a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png
deleted file mode 100644
index 61e71bdac8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
deleted file mode 100644
index 88381a5a80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
deleted file mode 100644
index 4bbc744806..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
deleted file mode 100644
index 60af21f5ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png
deleted file mode 100644
index 56911fe5a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.png
deleted file mode 100644
index 6aefae4bab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_editor_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
deleted file mode 100644
index 769aa825e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png
deleted file mode 100644
index b14dc15936..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png
deleted file mode 100644
index 8f6310c59f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
deleted file mode 100644
index c7c066427e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
deleted file mode 100644
index e6a9159fd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png
deleted file mode 100644
index 2cebe90add..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png
deleted file mode 100644
index 182350246d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png
deleted file mode 100644
index 8862770ac0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
deleted file mode 100644
index bede63b968..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
deleted file mode 100644
index 1aa1dbe059..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png
deleted file mode 100644
index 98ec0ac5b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml b/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
deleted file mode 100644
index 023c49b07f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
+++ /dev/null
@@ -1,544 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<index version="1.0">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref99" /></entry>
- </entry>
- <entry keyword="@Column">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref193" /></entry>
- </entry>
- <entry keyword="@DiscriminatorColumn">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref83" /></entry>
- </entry>
- <entry keyword="@DiscriminatorValue">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref85" /></entry>
- </entry>
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref68" /></entry>
- </entry>
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref103" /></entry>
- </entry>
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref107" /></entry>
- </entry>
- <entry keyword="@Entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref61" /></entry>
- </entry>
- <entry keyword="@Enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref203" /></entry>
- </entry>
- <entry keyword="@GeneratedValue">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref211" /></entry>
- </entry>
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref111" /></entry>
- </entry>
- <entry keyword="@Inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref81" /></entry>
- </entry>
- <entry keyword="@JoinColumn">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref122" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref132" /></entry>
- <entry keyword="Join Table Information"><topic href="reference014.htm#sthref208" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference015.htm#sthref210" /></entry>
- </entry>
- <entry keyword="@Lob">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref198" /></entry>
- </entry>
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref115" /></entry>
- </entry>
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref120" /></entry>
- </entry>
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref75" /></entry>
- </entry>
- <entry keyword="@NamedQuery">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref95" /></entry>
- </entry>
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref125" /></entry>
- </entry>
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref129" /></entry>
- </entry>
- <entry keyword="@OrderBy">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref206" /></entry>
- </entry>
- <entry keyword="@SequenceGenerator">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref213" /></entry>
- </entry>
- <entry keyword="@Temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref200" /></entry>
- </entry>
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref135" /></entry>
- </entry>
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref139" /></entry>
- </entry>
- <entry keyword="architecture of Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference034.htm#sthref247" /></entry>
- </entry>
- <entry keyword="attribute overrides">
- <entry keyword="Attribute overrides"><topic href="reference010.htm#sthref180" /></entry>
- </entry>
- <entry keyword="Attribute Overrides - in Java Details view">
- <entry keyword="Attribute overrides"><topic href="reference010.htm#sthref182" /></entry>
- </entry>
- <entry keyword="attributes">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref192" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref20" /></entry>
- </entry>
- </entry>
- <entry keyword="basic mapping">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref100" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref98" /></entry>
- </entry>
- <entry keyword="(See also mappings)"></entry>
- </entry>
- <entry keyword="classes">
- <entry keyword="adding persistence to">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref56" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref67" /></entry>
- </entry>
- <entry keyword="entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref59" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref73" /></entry>
- </entry>
- <entry keyword="synchronizing">
- <entry keyword="Synchronizing classes"><topic href="tasks003.htm#sthref43" /></entry>
- </entry>
- </entry>
- <entry keyword="columns">
- <entry keyword="discriminator">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref84" /></entry>
- </entry>
- <entry keyword="join">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref121" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref131" /></entry>
- <entry keyword="Join Table Information"><topic href="reference014.htm#sthref207" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference015.htm#sthref209" /></entry>
- </entry>
- <entry keyword="mapping to">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref194" /></entry>
- </entry>
- <entry keyword="value">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref86" /></entry>
- </entry>
- </entry>
- <entry keyword="database tables">
- <entry keyword="generating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref145" /></entry>
- </entry>
- </entry>
- <entry keyword="database - persistence">
- <entry keyword="connection">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref236" /></entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref238" /></entry>
- </entry>
- </entry>
- <entry keyword="developer documentation - Dali">
- <entry keyword="Dali Developer Documentation"><topic href="reference034.htm#sthref246" /></entry>
- </entry>
- <entry keyword="eager fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref196" /></entry>
- </entry>
- <entry keyword="embeddable class">
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref69" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref66" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded ID mapping">
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref108" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref106" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded mapping">
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref104" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref102" /></entry>
- </entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="@Entity annotation">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref62" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref19" /></entry>
- </entry>
- <entry keyword="creating">
- <entry keyword="Creating a JPA Entity"><topic href="tasks001.htm#sthref30" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref70" /></entry>
- </entry>
- <entry keyword="from tables">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref141" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref242" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref179" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref76" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref12" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref10" /></entry>
- </entry>
- <entry keyword="persistent">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref57" /></entry>
- <entry keyword="Entity"><topic href="tasks006.htm#sthref63" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref185" /></entry>
- </entry>
- </entry>
- <entry keyword="enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref202" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref204" /></entry>
- </entry>
- <entry keyword="error messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref146" /></entry>
- <entry keyword="Error messages"><topic href="tasks023.htm#sthref151" /></entry>
- </entry>
- <entry keyword="extension points - Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference034.htm#sthref248" /></entry>
- </entry>
- <entry keyword="fetch type">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref195" /></entry>
- </entry>
- <entry keyword="Generate Entities from Tables dialog">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref144" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref241" /></entry>
- </entry>
- <entry keyword="generated values">
- <entry keyword="ID mappings">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref212" /></entry>
- </entry>
- <entry keyword="sequence">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref214" /></entry>
- </entry>
- </entry>
- <entry keyword="ID mapping">
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref112" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref110" /></entry>
- </entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="entity">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref80" /></entry>
- <entry keyword="Inheritance information"><topic href="reference012.htm#sthref188" /></entry>
- </entry>
- <entry keyword="joined tables">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref92" /></entry>
- </entry>
- <entry keyword="single table">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref87" /></entry>
- </entry>
- </entry>
- <entry keyword="Inheritance - in Java Details view">
- <entry keyword="Inheritance information"><topic href="reference012.htm#sthref187" /></entry>
- </entry>
- <entry keyword="installation - Dali">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref3" /></entry>
- </entry>
- <entry keyword="joined tables - inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref93" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="attributes">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref190" /></entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref177" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Development perspective">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref244" /></entry>
- </entry>
- <entry keyword="JPA project">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref26" /></entry>
- </entry>
- <entry keyword="platform">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref235" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref216" /></entry>
- </entry>
- <entry keyword="lazy fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref197" /></entry>
- </entry>
- <entry keyword="many-to-many mapping">
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref116" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref114" /></entry>
- </entry>
- </entry>
- <entry keyword="many-to-one mapping">
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref119" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref118" /></entry>
- </entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref74" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref72" /></entry>
- </entry>
- </entry>
- <entry keyword="mapping entities">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref11" /></entry>
- </entry>
- <entry keyword="mappings">
- <entry keyword="about">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref21" /></entry>
- </entry>
- <entry keyword="basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref97" /></entry>
- </entry>
- <entry keyword="embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref101" /></entry>
- </entry>
- <entry keyword="embedded ID">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref105" /></entry>
- </entry>
- <entry keyword="ID">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref109" /></entry>
- </entry>
- <entry keyword="many-to-many">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref113" /></entry>
- </entry>
- <entry keyword="many-to-one">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref117" /></entry>
- </entry>
- <entry keyword="one-to-many">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref123" /></entry>
- </entry>
- <entry keyword="one-to-one">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref127" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref149" /></entry>
- </entry>
- <entry keyword="transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref133" /></entry>
- </entry>
- <entry keyword="version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref137" /></entry>
- </entry>
- </entry>
- <entry keyword="named queries">
- <entry keyword="entity">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref94" /></entry>
- </entry>
- </entry>
- <entry keyword="nonpersistent">
- <entry keyword="classes">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref55" /></entry>
- </entry>
- <entry keyword="fields. See transient"></entry>
- </entry>
- <entry keyword="one-to-many mapping">
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref126" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref124" /></entry>
- </entry>
- </entry>
- <entry keyword="one-to-one mapping">
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref130" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref128" /></entry>
- </entry>
- </entry>
- <entry keyword="ordering">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref205" /></entry>
- </entry>
- <entry keyword="orm.xml file">
- <entry keyword="about">
- <entry keyword="The orm.xml file"><topic href="concepts003.htm#sthref23" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref46" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref47" /></entry>
- </entry>
- </entry>
- <entry keyword="overrides - JPA attributes">
- <entry keyword="Attribute overrides"><topic href="reference010.htm#sthref181" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref18" /></entry>
- </entry>
- <entry keyword="database connection">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref237" /></entry>
- </entry>
- <entry keyword="database schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref240" /></entry>
- </entry>
- <entry keyword="entity class">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref54" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref232" /></entry>
- </entry>
- </entry>
- <entry keyword="Persistence XML Editor">
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref40" /></entry>
- </entry>
- <entry keyword="persistence.xml file">
- <entry keyword="about">
- <entry keyword="The persistence.xml file"><topic href="concepts002.htm#sthref22" /></entry>
- </entry>
- <entry keyword="editor">
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref41" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref35" /></entry>
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref38" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref52" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref36" /></entry>
- </entry>
- <entry keyword="synchronizing with classes">
- <entry keyword="Synchronizing classes"><topic href="tasks003.htm#sthref44" /></entry>
- </entry>
- </entry>
- <entry keyword="persistent entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref58" /></entry>
- </entry>
- <entry keyword="perspective - JPA Development">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref245" /></entry>
- </entry>
- <entry keyword="platform - JPA">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref234" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref148" /></entry>
- </entry>
- <entry keyword="projects - JPA">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="getting_started003.htm#sthref8" /></entry>
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref25" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref233" /></entry>
- </entry>
- </entry>
- <entry keyword="quick start - Dali">
- <entry keyword="Dali quick start"><topic href="getting_started002.htm#sthref7" /></entry>
- </entry>
- <entry keyword="requirements">
- <entry keyword="Dali Java Persistence Tools">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref4" /></entry>
- </entry>
- <entry keyword="persistent entities">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref60" /></entry>
- </entry>
- </entry>
- <entry keyword="schema - database">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref239" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref183" /></entry>
- </entry>
- <entry keyword="Secondary Tables - in Java Details view">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref186" /></entry>
- </entry>
- <entry keyword="single table inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref88" /></entry>
- </entry>
- <entry keyword="superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref77" /></entry>
- </entry>
- <entry keyword="tables">
- <entry keyword="creating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks020.htm#sthref142" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref243" /></entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref89" /></entry>
- </entry>
- <entry keyword="secondary">
- <entry keyword="Secondary table information"><topic href="reference011.htm#sthref184" /></entry>
- </entry>
- </entry>
- <entry keyword="temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref199" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref201" /></entry>
- </entry>
- <entry keyword="transient mapping">
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref136" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref134" /></entry>
- </entry>
- </entry>
- <entry keyword="version mapping">
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref140" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref138" /></entry>
- </entry>
- </entry>
- <entry keyword="views">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref178" /></entry>
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref191" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref215" /></entry>
- </entry>
- </entry>
- <entry keyword="warning messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks022.htm#sthref147" /></entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="Using the XML Editor to edit the persistence.xml file"><topic href="tasks002.htm#sthref37" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref51" /></entry>
- </entry>
-</index>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm b/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
deleted file mode 100644
index 25a99e40e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:55 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Legal</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Legal" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref256" name="sthref256"></a></p>
-<h1>Legal</h1>
-<p>Copyright &copy; 2006, 2008, Oracle. All rights reserved.</p>
-<p>This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at:</p>
-<p><code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code></p>
-<p><a href="about.htm">Terms and conditions regarding the use of this guide.</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
deleted file mode 100644
index 865c0824a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence Documentation - Doc
-providerName = Eclipse.org
-
-jpaDevelopment=JPA Development
-createAJpaProject=Create a JPA project
-createAJpaProjectDescription=This cheat sheet helps you create a JPA project.
-createAPersistentEntity=Create a persistent entity
-createAPersistentEntityDescription=This cheat sheet helps you create a Java persistent entity.
-MapAPersistentEntity=Map a persistent entity
-MapAPersistentEntityDescription=This cheat sheet helps you map the a Java persistent entity to a database table.
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
deleted file mode 100644
index 2f308f3991..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin name="JPA Documentation Plug-in" id="org.eclipse.jpt.doc.user" version="2.0.0" provider-name="Oracle">
- <!-- =========== -->
- <!-- Define TOC -->
- <!-- =========== -->
- <extension point="org.eclipse.help.toc">
- <toc file="toc.xml" primary="true"/>
- </extension>
- <!-- =========== -->
- <!-- Define F1 -->
- <!-- =========== -->
- <extension point="org.eclipse.help.contexts">
- <contexts file="contexts.xml" plugin="org.eclipse.jpt.ui"/>
- </extension>
- <!-- ==================== -->
- <!-- Define Keyword Index -->
- <!-- ==================== -->
- <extension point="org.eclipse.help.index">
- <index file="index.xml"/>
- </extension>
- <!-- =========== -->
- <!-- Cheatsheets -->
- <!-- =========== -->
- <extension point="org.eclipse.ui.cheatsheets.cheatSheetContent">
- <category name="%jpaDevelopment" id="com.jpa.category"/>
- <cheatsheet name="%createAJpaProject" category="com.jpa.category" contentFile="$nl$/cheatsheets/add_persistence.xml" id="org.eclipse.jpa.cheatsheet.createproject1">
- <description>%createAJpaProjectDescription</description>
- </cheatsheet>
- <cheatsheet name="%createAPersistentEntity" category="com.jpa.category" contentFile="$nl$/cheatsheets/create_entity.xml" id="org.eclipse.jpa.cheatsheet.addentity">
- <description>%createAPersistentEntityDescription</description>
- </cheatsheet>
- <cheatsheet name="%MapAPersistentEntity" category="com.jpa.category" contentFile="$nl$/cheatsheets/map_entity.xml" id="org.eclipse.jpa.cheatsheet.mapentity">
- <description>%MapAPersistentEntityDescription</description>
- </cheatsheet>
- </extension>
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
deleted file mode 100644
index cdda46b2ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Details view (for orm.xml)</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for orm.xml)" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGDGHC" name="CACGDGHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for orm.xml)</h1>
-<p>The <span class="gui-object-title">JPA Details</span> view displays the default mapping and persistence information for the project and contains the following areas:</p>
-<ul>
-<li>
-<p><a href="reference016.htm#CACCACGH">General information</a></p>
-</li>
-<li>
-<p><a href="reference017.htm#CACEAGBG">Persistence Unit information</a></p>
-</li>
-</ul>
-<p>These defaults can be overridden by the settings on a specific entity or mapping.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
deleted file mode 100644
index 88c5595061..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Facet page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Facet page" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACIFDIF" name="CACIFDIF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Facet page</h1>
-<p>This table lists the properties available on the JPA Facet page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t3">Property</th>
-<th align="left" valign="bottom" id="r1c2-t3">Description</th>
-<th align="left" valign="bottom" id="r1c3-t3">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t3" headers="r1c1-t3">Platform</td>
-<td align="left" headers="r2c1-t3 r1c2-t3">Vendor-specific JPA implementation.</td>
-<td align="left" headers="r2c1-t3 r1c3-t3">EclipseLink</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t3" headers="r1c1-t3">Connection</td>
-<td align="left" headers="r3c1-t3 r1c2-t3">Select the database connection to use with the project. Dali requires an active database connection to use and validate the persistent entities and mappings.
-<p>Click <span class="bold">Add connection</span> to create a new database connection.</p>
-</td>
-<td align="left" headers="r3c1-t3 r1c3-t3"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t3" headers="r1c1-t3">&nbsp;&nbsp;Override default schema from connection</td>
-<td align="left" headers="r4c1-t3 r1c2-t3">Select a schema other than the default one that is derived from the connection information. Use this option if the default schema cannot be used. For example, use this option when the deployment login differs from the design-time login.</td>
-<td align="left" headers="r4c1-t3 r1c3-t3">The value calculated by Dali.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t3" headers="r1c1-t3">JPA Implementation</td>
-<td align="left" headers="r5c1-t3 r1c2-t3">Select to use the <span class="bold">JPA implementation provided by the server at runtime</span>, or select a specific <span class="bold">implementation library</span> that contain the Java Persistence API (JPA) and entities to be added to the project's Java Build Path.
-<p>Click <span class="bold">Configure default JPA implementation library</span> to create a default library for the project or click <span class="bold">Configure user libraries</span> to define additional libraries.</p>
-</td>
-<td align="left" headers="r5c1-t3 r1c3-t3">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t3" headers="r1c1-t3">Persistent class management</td>
-<td align="left" headers="r6c1-t3 r1c2-t3">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t3 r1c3-t3">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t3" headers="r1c1-t3">Create orm.xml</td>
-<td align="left" headers="r7c1-t3 r1c2-t3">Specify if Dali should create a default <code>orm.xml</code> file for your entity mappings and persistence unit defaults.</td>
-<td align="left" headers="r7c1-t3 r1c3-t3">Selected</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
deleted file mode 100644
index df8834cfb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
+++ /dev/null
@@ -1,261 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBHFIJ" name="CACBHFIJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General properties available in the <span class="gui-object-title">Java Details view</span> for each mapping type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view." summary="This table describes the options on the Persistence Properties view." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t10">Property</th>
-<th align="left" valign="bottom" id="r1c2-t10">Description</th>
-<th align="left" valign="bottom" id="r1c3-t10">Default</th>
-<th align="left" valign="bottom" id="r1c4-t10">Available for Mapping Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t10" headers="r1c1-t10">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t10 r1c2-t10">Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of attribute.</td>
-<td align="left" headers="r2c1-t10 r1c3-t10">Basic</td>
-<td align="left" headers="r2c1-t10 r1c4-t10">All mapping types</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10"><a id="CACGCBHB" name="CACGCBHB"></a>Column</td>
-<td align="left" headers="r3c1-t10 r1c2-t10"><a id="sthref193" name="sthref193"></a><a id="sthref194" name="sthref194"></a>The database column that contains the value for the attribute. This field corresponds to the <code>@Column</code> annotation.</td>
-<td align="left" headers="r3c1-t10 r1c3-t10">By default, the Column is assumed to be named identically to the attribute.</td>
-<td align="left" headers="r3c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a>, <a href="tasks019.htm#BABHIBII">Version mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">Name of the database column.
-<p>This field corresponds to the <code>@Column</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r4c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r5c1-t10 r1c2-t10">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r5c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r5c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Insertable</td>
-<td align="left" headers="r6c1-t10 r1c2-t10">Specifies if the column is always included in <code>SQL INSERT</code> statements.</td>
-<td align="left" headers="r6c1-t10 r1c3-t10">True</td>
-<td align="left" headers="r6c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Updatable</td>
-<td align="left" headers="r7c1-t10 r1c2-t10">Specifies if this column is always included in <code>SQL UPDATE</code> statements.</td>
-<td align="left" headers="r7c1-t10 r1c3-t10">True</td>
-<td align="left" headers="r7c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Unique</td>
-<td align="left" headers="r8c1-t10 r1c2-t10">Sets the <code>UNIQUE</code> constraint for the column.</td>
-<td align="left" headers="r8c1-t10 r1c3-t10">False</td>
-<td align="left" headers="r8c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Nullable</td>
-<td align="left" headers="r9c1-t10 r1c2-t10">Specifies if the column allows null values.</td>
-<td align="left" headers="r9c1-t10 r1c3-t10">True</td>
-<td align="left" headers="r9c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Length</td>
-<td align="left" headers="r10c1-t10 r1c2-t10">Sets the column length.</td>
-<td align="left" headers="r10c1-t10 r1c3-t10">255</td>
-<td align="left" headers="r10c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Precision</td>
-<td align="left" headers="r11c1-t10 r1c2-t10">Sets the precision for the column values.</td>
-<td align="left" headers="r11c1-t10 r1c3-t10">0</td>
-<td align="left" headers="r11c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Scale</td>
-<td align="left" headers="r12c1-t10 r1c2-t10">Sets the number of digits that appear to the right of the decimal point.</td>
-<td align="left" headers="r12c1-t10 r1c3-t10">0</td>
-<td align="left" headers="r12c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Column Definition</td>
-<td align="left" headers="r13c1-t10 r1c2-t10">Define the DDL for a column. This is used when a table is being generated.</td>
-<td align="left" headers="r13c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r13c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t10" headers="r1c1-t10"><a id="CACGGGHB" name="CACGGGHB"></a><a id="sthref195" name="sthref195"></a><a id="sthref196" name="sthref196"></a><a id="sthref197" name="sthref197"></a>Fetch Type</td>
-<td align="left" headers="r14c1-t10 r1c2-t10">Defines how data is loaded from the database:
-<ul>
-<li>
-<p>Eager &ndash; Data is loaded in before it is actually needed.</p>
-</li>
-<li>
-<p>Lazy &ndash; Data is loaded only when required by the transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r14c1-t10 r1c3-t10">Eager</td>
-<td align="left" headers="r14c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t10" headers="r1c1-t10">Optional</td>
-<td align="left" headers="r15c1-t10 r1c2-t10">Specifies if this field is can be null.</td>
-<td align="left" headers="r15c1-t10 r1c3-t10">Yes</td>
-<td align="left" headers="r15c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r16c1-t10" headers="r1c1-t10"><a id="CACBBIBI" name="CACBBIBI"></a><a id="sthref198" name="sthref198"></a>Lob</td>
-<td align="left" headers="r16c1-t10 r1c2-t10">Specify if the field is mapped to <code>java.sql.Clob</code> or <code>java.sql.Blob</code>.
-<p>This field corresponds to the <code>@Lob</code> annotation.</p>
-</td>
-<td align="left" headers="r16c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r16c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r17c1-t10" headers="r1c1-t10"><a id="CACEAJGD" name="CACEAJGD"></a><a id="sthref199" name="sthref199"></a><a id="sthref200" name="sthref200"></a><a id="sthref201" name="sthref201"></a>Temporal</td>
-<td align="left" headers="r17c1-t10 r1c2-t10">Specifies if this field is one of the following:
-<ul>
-<li>
-<p>Date &ndash; <code>java.sql.Date</code></p>
-</li>
-<li>
-<p>Time &ndash; <code>java.sql.Time</code></p>
-</li>
-<li>
-<p>Timestamp &ndash; <code>java.sql.Timestamp</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Temporal</code> annotation.</p>
-</td>
-<td align="left" headers="r17c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r17c1-t10 r1c4-t10"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r18c1-t10" headers="r1c1-t10"><a id="sthref202" name="sthref202"></a><a id="sthref203" name="sthref203"></a><a id="sthref204" name="sthref204"></a>Enumerated</td>
-<td align="left" headers="r18c1-t10 r1c2-t10">Specify how to persist enumerated constraints if the <code>String</code> value suits your application requirements or to match an existing database schema.
-<ul>
-<li>
-<p>ordinal</p>
-</li>
-<li>
-<p><code>String</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Enumerated</code> annotation.</p>
-</td>
-<td align="left" headers="r18c1-t10 r1c3-t10">Ordinal</td>
-<td align="left" headers="r18c1-t10 r1c4-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r19c1-t10" headers="r1c1-t10">Target Entity</td>
-<td align="left" headers="r19c1-t10 r1c2-t10">The persistent entity to which the attribute is mapped.</td>
-<td align="left" headers="r19c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r19c1-t10 r1c4-t10"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a> <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r20c1-t10" headers="r1c1-t10"><a id="CACJAIHB" name="CACJAIHB"></a>Cascade Type</td>
-<td align="left" headers="r20c1-t10 r1c2-t10">Specify which operations are propagated throughout the entity.
-<ul>
-<li>
-<p>All &ndash; All operations</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Move</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-<li>
-<p>Refresh</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r20c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r20c1-t10 r1c4-t10"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a>, <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r21c1-t10" headers="r1c1-t10"><a id="CACJDJJA" name="CACJDJJA"></a>Mapped By</td>
-<td align="left" headers="r21c1-t10 r1c2-t10">The field in the database table that "owns" the relationship. This field is required only on the non-owning side of the relationship.</td>
-<td align="left" headers="r21c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r21c1-t10 r1c4-t10"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r22c1-t10" headers="r1c1-t10"><a id="CACDADIH" name="CACDADIH"></a><a id="sthref205" name="sthref205"></a><a id="sthref206" name="sthref206"></a>Order By</td>
-<td align="left" headers="r22c1-t10 r1c2-t10">Specify the default order for objects returned from a query:
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom ordering</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@OrderBy</code> annotation.</p>
-</td>
-<td align="left" headers="r22c1-t10 r1c3-t10">Primary key</td>
-<td align="left" headers="r22c1-t10 r1c4-t10"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a>. <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r23c1-t10" headers="r1c1-t10">Attribute Overrides</td>
-<td align="left" headers="r23c1-t10 r1c2-t10">Overrides <span class="bold">Basic</span> mappings of a mapped superclass (for example, if the inherited column name is incompatible with a pre-existing data model, or invalid as a column name in your database).</td>
-<td align="left" headers="r23c1-t10 r1c3-t10"><br /></td>
-<td align="left" headers="r23c1-t10 r1c4-t10"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a>
-<p><a href="tasks011.htm#BABCBHDF">Embedded mapping</a></p>
-<br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
deleted file mode 100644
index 36e6f539f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>New JPA Project page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New JPA Project page" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBJAGC" name="CACBJAGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>New JPA Project page</h1>
-<p>This table lists the properties available on the New JPA Project page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Property</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-<th align="left" valign="bottom" id="r1c3-t2">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2">Project name</td>
-<td align="left" headers="r2c1-t2 r1c2-t2">Name of the Eclipse JPA project.</td>
-<td align="left" headers="r2c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2">Project contents</td>
-<td align="left" headers="r3c1-t2 r1c2-t2">Location of the workspace in which to save the project.
-<p>Unselect The <span class="bold">Use Default</span> option and click <span class="bold">Browse</span> to select a new location.</p>
-</td>
-<td align="left" headers="r3c1-t2 r1c3-t2">Current workspace</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t2" headers="r1c1-t2">Target runtime</td>
-<td align="left" headers="r4c1-t2 r1c2-t2">Select a pre-defined target for the project.
-<p>Click <span class="bold">New</span> to create a new environment with the New Server Runtime wizard.</p>
-</td>
-<td align="left" headers="r4c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t2" headers="r1c1-t2">Configurations</td>
-<td align="left" headers="r5c1-t2 r1c2-t2">Select a project configuration with pre-defined facets.
-<p>Select <span class="bold">&lt;custom&gt;</span> to manually select the facets for this project.</p>
-</td>
-<td align="left" headers="r5c1-t2 r1c3-t2">Utility JPA project with Java 5.0</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t2" headers="r1c1-t2">EAR membership</td>
-<td align="left" headers="r6c1-t2 r1c2-t2">Specify if this project should be included in an EAR file for deployment.
-<p>Select the <span class="bold">EAR Project Name</span>, or click <span class="bold">New</span> to create a new EAR project.</p>
-</td>
-<td align="left" headers="r6c1-t2 r1c3-t2"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
deleted file mode 100644
index bfb014e70e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create New JPA Project wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New JPA Project wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBJGBG" name="CACBJGBG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create New JPA Project wizard</h1>
-<p>The Create New JPA Project wizard allows you to create a new Java project using JPA. The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a></p>
-</li>
-<li>
-<p><a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
deleted file mode 100644
index aba760059b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Details view (for attributes)</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for attributes)" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIFBAF" name="BABIFBAF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for attributes)</h1>
-<p><a id="sthref190" name="sthref190"></a><a id="sthref191" name="sthref191"></a><a id="sthref192" name="sthref192"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected mapped attribute and contains the following areas:</p>
-<ul>
-<li>
-<p><a href="ref_mapping_general.htm#CACBHFIJ">General information</a></p>
-</li>
-<li>
-<p><a href="reference014.htm#CACBAEBC">Join Table Information</a></p>
-</li>
-<li>
-<p><a href="reference015.htm#CACFCEJC">Join Columns Information</a></p>
-</li>
-<li>
-<p><a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
deleted file mode 100644
index 11fa6b2224..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Structure view</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Structure view" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEGGFE" name="BABEGGFE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Structure view</h1>
-<p><a id="sthref215" name="sthref215"></a><a id="sthref216" name="sthref216"></a>The <span class="gui-object-title">JPA Structure</span> view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor. The structural elements shown in the outline are the entity and its fields.</p>
-<div class="figure"><a id="sthref217" name="sthref217"></a>
-<p class="titleinfigure">Sample JPA Structure View</p>
-<img src="img/persistence_outline_view.png" alt="Sample JPA Structure view for an entity." title="Sample JPA Structure view for an entity." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
deleted file mode 100644
index 7099087ada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Development perspective</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Development perspective" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIFBDB" name="BABIFBDB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Development perspective</h1>
-<p><a id="sthref244" name="sthref244"></a><a id="sthref245" name="sthref245"></a>The <span class="bold">JPA Development perspective</span> defines the initial set and layout of views in the Workbench window when using Dali. By default, the <span class="gui-object-title">JPA Development perspective</span> includes the following views:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-</ul>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/concepts-4.htm">Perspectives</a></p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
deleted file mode 100644
index d7a07c83d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>JPA Details view (for entities)</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for entities)" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAEBB" name="BABFAEBB"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for entities)</h1>
-<p><a id="sthref177" name="sthref177"></a><a id="sthref178" name="sthref178"></a><a id="sthref179" name="sthref179"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected entity and contains the following tabs:</p>
-<ul>
-<li>
-<p><a href="reference009.htm#CACCAGGC">General information</a></p>
-</li>
-<li>
-<p><a href="reference010.htm#CACIJBGH">Attribute overrides</a></p>
-</li>
-<li>
-<p><a href="reference011.htm#CACBHIDA">Secondary table information</a></p>
-</li>
-<li>
-<p><a href="reference012.htm#CACFHGHE">Inheritance information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
deleted file mode 100644
index c98a548484..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
+++ /dev/null
@@ -1,138 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Primary Key Generation information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Primary Key Generation information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCCAB" name="CACFCCAB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Primary Key Generation information</h1>
-<p>This table lists the fields available in the <span class="gui-object-title">Primary Key Generation</span> area in JPA Details view for <a href="tasks013.htm#BABGCBHG">ID mapping</a> types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-<th align="left" valign="bottom" id="r1c3-t13">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13"><a id="CACBAJBC" name="CACBAJBC"></a>Primary Key Generation</td>
-<td align="left" headers="r2c1-t13 r1c2-t13"><a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></a>These fields define how the primary key is generated. These fields correspond to the <code>@GeneratedValue</code> annotation.</td>
-<td align="left" headers="r2c1-t13 r1c3-t13">Generated Value</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13"><a id="CACJEEEC" name="CACJEEEC"></a>&nbsp;&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">
-<ul>
-<li>Auto</li>
-<li>
-<p>Identity &ndash; Values are assigned by the database's <span class="bold">Identity</span> column.</p>
-</li>
-<li>
-<p>Sequence &ndash; Values are assigned by a sequence table (see <a href="#CACFFHEH">Sequence&nbsp;Generator</a>).</p>
-</li>
-<li>
-<p>Table &ndash; Values are assigned by a database table (see <a href="#CACGFEAH">Table Generator</a>).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t13 r1c3-t13">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13"><a id="BABEEAHJ" name="BABEEAHJ"></a>&nbsp;&nbsp;Generator Name</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">Unique name of the generated value.</td>
-<td align="left" headers="r4c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t13" headers="r1c1-t13"><a id="CACGFEAH" name="CACGFEAH"></a>Table Generator</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">These fields define the database table used for generating the primary key and correspond to the <code>@TableGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span>&nbsp;=&nbsp;<span class="bold">Table</span>.</p>
-</td>
-<td align="left" headers="r5c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r6c1-t13 r1c2-t13">Unique name of the generator.</td>
-<td align="left" headers="r6c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r7c1-t13 r1c2-t13">Database table that stores the generated ID values.</td>
-<td align="left" headers="r7c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Primary Key Column</td>
-<td align="left" headers="r8c1-t13 r1c2-t13">The column in the table generator's <span class="bold">Table</span> that contains the primary key.</td>
-<td align="left" headers="r8c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Value Column</td>
-<td align="left" headers="r9c1-t13 r1c2-t13">The column that stores the generated ID values.</td>
-<td align="left" headers="r9c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Primary Key Column Value</td>
-<td align="left" headers="r10c1-t13 r1c2-t13">The value for the <span class="bold">Primary Key Column</span> in the generator table.</td>
-<td align="left" headers="r10c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t13" headers="r1c1-t13"><a id="CACFFHEH" name="CACFFHEH"></a>Sequence&nbsp;Generator</td>
-<td align="left" headers="r11c1-t13 r1c2-t13"><a id="sthref213" name="sthref213"></a><a id="sthref214" name="sthref214"></a>These fields define the specific sequence used for generating the primary key and correspond to the <code>@SequenceGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span> = <span class="bold">Sequence</span>.</p>
-</td>
-<td align="left" headers="r11c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r12c1-t13 r1c2-t13">Name of the sequence table to use for defining primary key values.</td>
-<td align="left" headers="r12c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Sequence</td>
-<td align="left" headers="r13c1-t13 r1c2-t13">Unique name of the sequence.</td>
-<td align="left" headers="r13c1-t13 r1c3-t13"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks013.htm#BABGCBHG">ID mapping</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
deleted file mode 100644
index 0fd473e54b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Project Properties page - JPA Options</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page - JPA Options" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABJHBCI" name="BABJHBCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Project Properties page &ndash; JPA Options</h1>
-<p><a id="sthref232" name="sthref232"></a><a id="sthref233" name="sthref233"></a>Use the <span class="gui-object-title">JPA</span> options on the <span class="gui-object-title">Properties</span> page to select the database connection to use with the project.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">JPA Details page</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties page." summary="This table describes the options on the Persistence Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t28">Property</th>
-<th align="left" valign="bottom" id="r1c2-t28">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t28" headers="r1c1-t28"><a id="sthref234" name="sthref234"></a><a id="sthref235" name="sthref235"></a><a id="sthref236" name="sthref236"></a><a id="sthref237" name="sthref237"></a>Platform</td>
-<td align="left" headers="r2c1-t28 r1c2-t28">Select the vendor-specific platform.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t28" headers="r1c1-t28"><a id="sthref238" name="sthref238"></a><a id="sthref239" name="sthref239"></a><a id="sthref240" name="sthref240"></a>Connection</td>
-<td align="left" headers="r3c1-t28 r1c2-t28">The database connection used to map the persistent entities.
-<ul>
-<li>
-<p>To create a new connection, click <span class="bold">Add Connections</span>.</p>
-</li>
-<li>
-<p>To reconnect to an existing connection, click <span class="bold">Reconnect</span>.</p>
-</li>
-</ul>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t28" headers="r1c1-t28">&nbsp;&nbsp;Override default schema from connection</td>
-<td align="left" headers="r4c1-t28 r1c2-t28">Select a schema other than the default one derived from the connection information. Use this option if the default schema is incorrect or cannot be used. For example, use this option when the deployment login differs from the design-time login.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t28" headers="r1c1-t28">Persistent Class Management</td>
-<td align="left" headers="r5c1-t28 r1c2-t28">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks025.htm#BABDBCBI">Modifying persistent project properties</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
deleted file mode 100644
index ccf4052c61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Reference</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Reference" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref168" name="sthref168"></a></p>
-<h1>Reference</h1>
-<p>This section includes detailed help information for each of the following elements in the Dali OR Mapping Tool:</p>
-<ul>
-<li>
-<p><a href="reference001.htm#CACJJJJH">Wizards</a></p>
-</li>
-<li>
-<p><a href="reference008.htm#CACDJIIG">Property pages</a></p>
-</li>
-<li>
-<p><a href="reference028.htm#CACDEIEE">Preferences</a></p>
-</li>
-<li>
-<p><a href="reference029.htm#CACGEJDA">Dialogs</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a></p>
-</li>
-<li>
-<p><a href="reference031.htm#CACDHCIA">Icons and buttons</a></p>
-</li>
-<li>
-<p><a href="reference034.htm#CACBBDIB">Dali Developer Documentation</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
deleted file mode 100644
index 0c326d1c60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Wizards</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Wizards" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACJJJJH" name="CACJJJJH"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Wizards</h1>
-<p>This section includes information on the following wizards:</p>
-<ul>
-<li>
-<p><a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></p>
-</li>
-<li>
-<p><a href="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
deleted file mode 100644
index 55322e391c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create JPA Entity wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create JPA Entity wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGGGDF" name="CIAGGGDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create JPA Entity wizard</h1>
-<p>The Create JPA wizard enables you to quickly add an entity and also add persistence fields to that entity. In addition, this wizard adds the accessor methods (<code>getter</code> and <code>setter</code>) in the class file. The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="reference003.htm#CIAFEIGF">Entity Class page</a></p>
-</li>
-<li>
-<p><a href="reference004.htm#CIADECIA">Entity Properties page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
deleted file mode 100644
index 2cb08d872b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
+++ /dev/null
@@ -1,131 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Entity Class page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Class page" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFEIGF" name="CIAFEIGF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Entity Class page</h1>
-<p>This table lists the properties of the Entity Class page of the <a href="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="tblformal"><a id="sthref169" name="sthref169"></a><a id="sthref170" name="sthref170"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table describes the Entity Class page of the Create JPA Entities wizard." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t4">Property</th>
-<th align="left" valign="bottom" id="r1c2-t4">Description</th>
-<th align="left" valign="bottom" id="r1c3-t4">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t4" headers="r1c1-t4">
-<p>Project</p>
-</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">
-<p>The name of t he JPA project.</p>
-</td>
-<td align="left" headers="r2c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4">
-<p>Source Folder</p>
-</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">
-<p>The location of the JPA project's src folder.</p>
-</td>
-<td align="left" headers="r3c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t4" headers="r1c1-t4">
-<p>Java Package</p>
-</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">
-<p>The name of the class package.</p>
-</td>
-<td align="left" headers="r4c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">
-<p>Class name</p>
-</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">
-<p>The name of the Java class.</p>
-</td>
-<td align="left" headers="r5c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">
-<p>Superclass</p>
-</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">
-<p>Select the superclass.</p>
-</td>
-<td align="left" headers="r6c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t4" headers="r1c1-t4">
-<p>Inheritance</p>
-</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">
-<p>Because the wizard creates a Java class with an <code>@Entity</code> notation, the <span class="bold">Entity</span> option is selected by default.</p>
-<p>Select <span class="bold">Mapped Superclass</span> if you defined a superclass.</p>
-<p>To add an <code>@Inheritance</code> notation to the entity, select <span class="bold">Inheritance</span> and then select one of the inheritance mapping strategies (described in JSR 220):</p>
-<ul>
-<li>
-<p>SINGLE_TABLE -- All classes in a hierarchy as mapped to a single table. This annotation is without an attribute for the inheritance strategy.</p>
-</li>
-<li>
-<p>TABLE_PER_CLASS -- Each class is mapped to a separate table.</p>
-</li>
-<li>
-<p>JOINED -- The root of the class hierarchy is represented by a single table. Each subclass is represented by a separate table that contains those fields that are specific to the subclass (not inherited from its superclass), as well as the column(s) that represent its primary key. The primary key column(s) of the subclass table serves as a foreign key to the primary key of the superclass table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t4 r1c3-t4">
-<p>Entity</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t4" headers="r1c1-t4">
-<p>XML Entity Mappings</p>
-</td>
-<td align="left" headers="r8c1-t4 r1c2-t4">
-<p>Select <span class="bold">Add to entity mappings in XML</span> to create XML mappings in <code>orm.xml</code>, rather than annotations.</p>
-</td>
-<td align="left" headers="r8c1-t4 r1c3-t4"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
deleted file mode 100644
index fd1b9996f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Entity Properties page</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Properties page" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIADECIA" name="CIADECIA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Entity Properties page</h1>
-<p>This table lists the properties of the Entity Properties page of the <a href="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="tblformal"><a id="sthref171" name="sthref171"></a><a id="sthref172" name="sthref172"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table to be converted to informal." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t5">Property</th>
-<th align="left" valign="bottom" id="r1c2-t5">Description</th>
-<th align="left" valign="bottom" id="r1c3-t5">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5">
-<p>Entity Name</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">
-<p>The name of the entity. By default, this value is the same as the one entered as the class name. If the entity name differs from the class name, then the entity name is added as an attribute. For example: <code>@Entity(name="EntityName")</code>.</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c3-t5">
-<p>Determined by server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">
-<p>Table Name</p>
-</td>
-<td align="left" headers="r3c1-t5 r1c2-t5">
-<p>Select <span class="bold">Use default</span> to match the name of the mapped table name to the entity name. Otherwise, clear the <span class="bold">Use default</span> option and enter the name in the <span class="italic">Table Name</span> field. These options result in the addition of the <code>@Table</code> option to the Java class file.</p>
-</td>
-<td align="left" headers="r3c1-t5 r1c3-t5">
-<p>Use default.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r1c1-t5">
-<p>Entity Fields</p>
-</td>
-<td align="left" headers="r4c1-t5 r1c2-t5">
-<p>Click the <span class="bold">Add</span> button to add persistence fields using the Entity Fields dialog. This dialog enable you to build a field by entering a field name and selecting among persistence types. The <span class="bold">Key</span> option enables you to mark a field as a primary key. The dialog's <span class="bold">Browse</span> function enables you to add other persistence types described in the JPA specification. The <span class="bold">Edit</span> button enables you to change the name or type set for a persistent field.</p>
-</td>
-<td align="left" headers="r4c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t5" headers="r1c1-t5">
-<p>Access Type</p>
-</td>
-<td align="left" headers="r5c1-t5 r1c2-t5">
-<p>Select whether the entity's access to instance variables is field-based or property-based, as defined in the JPA specification.</p>
-<ul>
-<li>
-<p><span class="bold">Field-based</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-<li>
-<p><span class="bold">Property-based</span> &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t5 r1c3-t5">
-<p>Field-based</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks001.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
deleted file mode 100644
index 6bd404341b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping File Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAIJCCE" name="CIAIJCCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Mapping File Wizard</h1>
-<p>The Mapping File wizard enables you to add an <code>orm.xml</code> file to a JPA project if no object map exists at the location specified. For example, if you cleared the <span class="bold">Create orm.xml</span> option on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a>, you can later add the <code>orm.xml</code> file to the src file of the project using this wizard.</p>
-<p>The <a href="#CIAIJCCE">Mapping File Wizard</a> consists of the Mapping File page.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
deleted file mode 100644
index 2028c23e2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping File Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref173" name="sthref173"></a>
-<h1>Mapping File</h1>
-<p>This table lists the properties of the <a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div class="tblformal"><a id="sthref174" name="sthref174"></a><a id="sthref175" name="sthref175"></a>
-<p class="titleintable">Mapping File Wizard Properties</p>
-<table class="Formal" title="Mapping File Wizard Properties" summary="" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t6">Property</th>
-<th align="left" valign="bottom" id="r1c2-t6">Description</th>
-<th align="left" valign="bottom" id="r1c3-t6">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t6" headers="r1c1-t6">
-<p>Project</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">
-<p>The name of the JPA project.</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6">
-<p>Source folder</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c2-t6">
-<p>The location of the project's src folder. If needed, click <span class="bold">Browse</span> to point the wizard to the src file's location.</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t6" headers="r1c1-t6">
-<p>File Path</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c2-t6">
-<p>The location for the new <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t6" headers="r1c1-t6">
-<p>Default Access</p>
-</td>
-<td align="left" headers="r5c1-t6 r1c2-t6">
-<p>Select whether the access to the entity is field-based or property-based, as defined in JPA specification.</p>
-<ul>
-<li>
-<p>None &ndash; No access type specified.</p>
-</li>
-<li>
-<p><span class="bold">Property-based</span> &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p><span class="bold">Field-based</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t6 r1c3-t6">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t6" headers="r1c1-t6">
-<p>Add to persistence unit</p>
-</td>
-<td align="left" headers="r6c1-t6 r1c2-t6">
-<p>Designates the persistence unit for this object map file.</p>
-</td>
-<td align="left" headers="r6c1-t6 r1c3-t6">
-<p>Selected.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
deleted file mode 100644
index de8a03ae2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping File Wizard Properties</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard Properties" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref176" name="sthref176"></a>
-<h1>Generate DDL from Entities Wizard</h1>
-<p>The Generate DDL from Entities Wizard to quickly create DDL scripts from your persistent entities. Dali automatically creates the necessary primary and foreign keys, based on the entity mappings.</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
deleted file mode 100644
index e1a36d01e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Property pages</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Property pages" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDJIIG" name="CACDJIIG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Property pages</h1>
-<p>This section includes information on the following:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
deleted file mode 100644
index f1b9b244be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCAGGC" name="CACCAGGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-<th align="left" valign="bottom" id="r1c3-t7">Default</th>
-<th align="left" valign="bottom" id="r1c4-t7">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of entity: Mapped Superclass, Embeddable or the default mapping type.</td>
-<td align="left" headers="r2c1-t7 r1c3-t7">Entity</td>
-<td align="left" headers="r2c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a>, <a href="tasks007.htm#BABFEICE">Embeddable</a>, and <a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7">Name</td>
-<td align="left" headers="r3c1-t7 r1c2-t7">The name of this entity. By default, the class name is used as the entity name.</td>
-<td align="left" headers="r3c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r3c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">Table</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">The default database table information for this entity. These fields can be overridden by the information in the <a href="reference010.htm#CACIJBGH">Attribute overrides</a> area.</td>
-<td align="left" headers="r4c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r4c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r5c1-t7 r1c2-t7">The name of the primary database table associated with the entity.</td>
-<td align="left" headers="r5c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r5c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Catalog</td>
-<td align="left" headers="r6c1-t7 r1c2-t7">The database catalog that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r6c1-t7 r1c3-t7">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r6c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Schema</td>
-<td align="left" headers="r7c1-t7 r1c2-t7">The database schema that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r7c1-t7 r1c3-t7">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r7c1-t7 r1c4-t7"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
deleted file mode 100644
index 21bdad0d62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Attribute overrides</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Attribute overrides" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACIJBGH" name="CACIJBGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Attribute overrides</h1>
-<p><a id="sthref180" name="sthref180"></a><a id="sthref181" name="sthref181"></a><a id="sthref182" name="sthref182"></a>Use the <span class="gui-object-title">Attribute Overrides</span> area in the <span class="gui-object-title">JPA Details</span> view to override the default settings specified in the <a href="reference009.htm#CACCAGGC">General information</a> area of an attribute. Attribute overrides generally override/configure attribtues that are inherited or embedded.</p>
-<p>This table lists the Attribute override fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Default</th>
-<th align="left" valign="bottom" id="r1c4-t8">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Attribute Overrides</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Specify a property or field to be overridden (from the default mappings). Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8"><br /></td>
-<td align="left" headers="r2c1-t8 r1c4-t8"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">Join Columns</td>
-<td align="left" headers="r3c1-t8 r1c2-t8"><br /></td>
-<td align="left" headers="r3c1-t8 r1c3-t8"><br /></td>
-<td align="left" headers="r3c1-t8 r1c4-t8"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference009.htm#CACCAGGC">General information</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
deleted file mode 100644
index ed5e368429..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Secondary table information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Secondary table information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBHIDA" name="CACBHIDA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Secondary table information</h1>
-<p><a id="sthref183" name="sthref183"></a><a id="sthref184" name="sthref184"></a><a id="sthref185" name="sthref185"></a><a id="sthref186" name="sthref186"></a>Use the <span class="gui-object-title">Secondary Tables</span> area in the <span class="gui-object-title">JPA Details</span> view to associate additional tables with an entity. Use this area if the data associated with an entity is spread across multiple tables.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
deleted file mode 100644
index 544604dfb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Inheritance information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFHGHE" name="CACFHGHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Inheritance information</h1>
-<p><a id="sthref187" name="sthref187"></a><a id="sthref188" name="sthref188"></a>This table lists the fields available on the <span class="gui-object-title">Inheritance</span> area in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t9">Property</th>
-<th align="left" valign="bottom" id="r1c2-t9">Description</th>
-<th align="left" valign="bottom" id="r1c3-t9">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t9" headers="r1c1-t9">Strategy</td>
-<td align="left" headers="r2c1-t9 r1c2-t9">Specify the strategy to use when mapping a class or class hierarchy:
-<ul>
-<li>
-<p>Single table &ndash; All classes in the hierarchy are mapped to a single table.</p>
-</li>
-<li>
-<p>Joined &ndash; The root of the hierarchy is mapped to a single table; each child maps to its own table.</p>
-</li>
-<li>
-<p>Table per class &ndash; Each class is mapped to a separate table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t9 r1c3-t9">Single table</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t9" headers="r1c1-t9">Discriminator Column</td>
-<td align="left" headers="r3c1-t9 r1c2-t9">Use to specify the name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.</td>
-<td align="left" headers="r3c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t9" headers="r1c1-t9">Discriminator Type</td>
-<td align="left" headers="r4c1-t9 r1c2-t9">Set this field to set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r4c1-t9 r1c3-t9">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t9" headers="r1c1-t9">Discriminator Value</td>
-<td align="left" headers="r5c1-t9 r1c2-t9">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.</td>
-<td align="left" headers="r5c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t9" headers="r1c1-t9">Primary Key Join Columns</td>
-<td align="left" headers="r6c1-t9 r1c2-t9">Use to override the default primary key join columns. Select <span class="bold">Override Default</span>, then click <span class="bold">Add</span> to select new Join Column.
-<p>This field corresponds with @PrimaryKeyJoinColumn annotation.</p>
-</td>
-<td align="left" headers="r6c1-t9 r1c3-t9"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
deleted file mode 100644
index dd495829e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Inheritance information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref189" name="sthref189"></a>
-<h1>Queries</h1>
-<p>Use the queries area of the JPA Details view to create named queries and named native queries. Refer to <a href="tasks009.htm#BABIGBGG">"Creating Named Queries"</a> for additional information.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks009.htm#BABIGBGG">Creating Named Queries</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
deleted file mode 100644
index d19978121e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Join Table Information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Table Information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBAEBC" name="CACBAEBC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Table Information</h1>
-<p>Use area to specify a mapped column for joining an entity association. By default, the mapping is assumed to have a single join.</p>
-<p>This table lists the fields available on the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">the JPA Details</span> view for <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a> and <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Table tab." summary="This table describes the options on the Join Table tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t11">Property</th>
-<th align="left" valign="bottom" id="r1c2-t11">Description</th>
-<th align="left" valign="bottom" id="r1c3-t11">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t11" headers="r1c1-t11">Name</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t11 r1c3-t11">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t11" headers="r1c1-t11"><a id="CACBBDFG" name="CACBBDFG"></a>Join Columns</td>
-<td align="left" headers="r3c1-t11 r1c2-t11"><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r3c1-t11 r1c3-t11">By default, the mapping is assumed to have a single join.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t11" headers="r1c1-t11">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t11 r1c2-t11">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t11 r1c3-t11"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference030.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
deleted file mode 100644
index 11e35fa477..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:50 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Join Columns Information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns Information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCEJC" name="CACFCEJC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Columns Information</h1>
-<p>This table lists the fields available in the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">JPA Details</span> view for <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a> and <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t12">Property</th>
-<th align="left" valign="bottom" id="r1c2-t12">Description</th>
-<th align="left" valign="bottom" id="r1c3-t12">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t12" headers="r1c1-t12">Join Column</td>
-<td align="left" headers="r2c1-t12 r1c2-t12"><a id="sthref209" name="sthref209"></a><a id="sthref210" name="sthref210"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t12 r1c3-t12">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference030.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
deleted file mode 100644
index b938a47f57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCACGH" name="CACCACGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Package</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">The Java package that contains the persistent entities. Click <span class="bold">Browse</span> and select the package</td>
-<td align="left" headers="r2c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Schema</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14">Catalog</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Access</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">Specify the default access method for the variables in the project:
-<ul>
-<li>
-<p>Property</p>
-</li>
-<li>
-<p>Field</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>&lt;access&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t14 r1c3-t14"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
deleted file mode 100644
index e183172b5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Persistence Unit information</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Persistence Unit information" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACEAGBG" name="CACEAGBG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Persistence Unit information</h1>
-<p>This table lists the Persistence Unit information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type. These fields are contained in the <code>&lt;persistence-unit-metadata&gt;</code> element in the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">XML Mapping Data Complete</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.
-<p>This field corresponds to the <code>&lt;xml-mapping-metadata-complete&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r2c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Schema</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15">Catalog</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t15" headers="r1c1-t15">Access Type</td>
-<td align="left" headers="r5c1-t15 r1c2-t15">Specify how the entity its access instance variables.
-<ul>
-<li>
-<p>Property &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p>Field &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t15 r1c3-t15">Property</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15">Cascade Persist</td>
-<td align="left" headers="r6c1-t15 r1c2-t15">Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.
-<p>This field corresponds to the <code>&lt;cascade-persist&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r6c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
deleted file mode 100644
index fbdbc4646d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>persistence.xml Editor</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="persistence.xml Editor" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACCHID" name="CIACCHID"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>persistence.xml Editor</h1>
-<p>The persistence.xml Editor provides an interface that enables you to update the persistence.xml file. For projects using the EclipseLink platform, the perisistence.xml Editor consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="reference019.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference020.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference021.htm#CIAJAFEG">Customization</a></p>
-</li>
-<li>
-<p><a href="reference022.htm#CIABEDCH">Caching</a></p>
-</li>
-<li>
-<p><a href="reference023.htm#CIABGHHI">Logging</a></p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAFJCHE">Options</a></p>
-</li>
-<li>
-<p><a href="reference025.htm#CIACCFCB">Schema Generation</a></p>
-</li>
-<li>
-<p><a href="reference026.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference027.htm#CIAHCJAH">Source</a></p>
-</li>
-</ul>
-<p>For projects using the Generic platform, the following subset of these pages is available:</p>
-<ul>
-<li>
-<p><a href="reference019.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference020.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference026.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference027.htm#CIAHCJAH">Source</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm
deleted file mode 100644
index 69660c6367..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>General</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACIFGJ" name="CIACIFGJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General</h1>
-<p>The following table lists properties available in the General page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref218" name="sthref218"></a><a id="sthref219" name="sthref219"></a>
-<p class="titleintable">Properties of the General Page</p>
-<table class="Formal" title="Properties of the General Page" summary="This table describes the properties of the persistence.xml&rsquo;s General page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">
-<p>Name</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">
-<p>Enter the name of the persistence unit.</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">
-<p>The project name.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16">
-<p>Persistence Provider</p>
-</td>
-<td align="left" headers="r3c1-t16 r1c2-t16">
-<p>Enter the name of the persistence provider.</p>
-</td>
-<td align="left" headers="r3c1-t16 r1c3-t16">
-<p>Determined by the server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16">
-<p>Description</p>
-</td>
-<td align="left" headers="r4c1-t16 r1c2-t16">
-<p>Enter a description for this persistence unit. This is an optional property.</p>
-</td>
-<td align="left" headers="r4c1-t16 r1c3-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t16" headers="r1c1-t16">
-<p>Managed Classes</p>
-</td>
-<td align="left" headers="r5c1-t16 r1c2-t16">
-<p>Add or remove the classes managed through the persistence unit.</p>
-</td>
-<td align="left" headers="r5c1-t16 r1c3-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t16" headers="r1c1-t16">
-<p>Exclude Unlisted Classes</p>
-</td>
-<td align="left" headers="r6c1-t16 r1c2-t16">
-<p>Select to include all annotated entity classes in the root of the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t16 r1c3-t16">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t16" headers="r1c1-t16">
-<p>XML Mapping Files</p>
-</td>
-<td align="left" headers="r7c1-t16 r1c2-t16">
-<p>Add or remove the object/relational mapping XML files that define the classes to be managed by the persistence unit.</p>
-</td>
-<td align="left" headers="r7c1-t16 r1c3-t16">
-<p>Meta-INF\orm.xml</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
deleted file mode 100644
index 672b473bea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Connection</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Connection" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFFJIE" name="CIAFFJIE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Connection</h1>
-<p>The following table lists the properties available in the Connection page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref220" name="sthref220"></a><a id="sthref221" name="sthref221"></a>
-<p class="titleintable">Properties of the Connection Page</p>
-<table class="Formal" title="Properties of the Connection Page" summary="This table lists the properties for the persistence.xml editor&rsquo;s connection page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">
-<p>Transaction Type</p>
-</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">
-<p>Specify if the connection for this persistence unit uses one of the following transaction types:</p>
-<ul>
-<li>
-<p><span class="bold">Default</span> -- Select to use the container used by the container.</p>
-</li>
-<li>
-<p><span class="bold">JTA</span> (Java Transaction API) -- Transactions of the Java EE server.</p>
-</li>
-<li>
-<p><span class="bold">Resource Local</span> -- Native actions of a JDBC driver that are referenced by a persistence unit.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17">
-<p>Batch Writing</p>
-</td>
-<td align="left" headers="r3c1-t17 r1c2-t17">
-<p>Specify the use of batch writing to optimize transactions with multiple write operations.</p>
-<p>Set the value of this property into the session at deployment time.</p>
-<p>Note: This property applies when used both in a Java SE and Java EE environment.</p>
-<p>The following are the valid values for oracle.toplink.config.BatchWriting:</p>
-<ul>
-<li>
-<p><span class="bold">JDBC</span>&ndash;Use JDBC batch writing.</p>
-</li>
-<li>
-<p><span class="bold">Buffered</span>&ndash;Do not use either JDBC batch writing nor native platform batch writing.</p>
-</li>
-<li>
-<p><span class="bold">OracleJDBC</span>&ndash;Use both JDBC batch writing and Oracle native platform batch writing.</p>
-</li>
-<li>
-<p><span class="bold">None</span>&ndash;Do not use batch writing (turn it off).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t17 r1c3-t17">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">
-<p>JTA Data Source Name</p>
-</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">
-<p>If you selected <span class="bold">JTA</span> as the transaction type, then enter the name of the default JTA data source for the persistence unit.</p>
-</td>
-<td align="left" headers="r4c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t17" headers="r1c1-t17">
-<p>Non-JTA Data Source Name</p>
-</td>
-<td align="left" headers="r5c1-t17 r1c2-t17">
-<p>If you selected <span class="bold">Resource Local</span> as the transaction type, then enter the name of the non-JTA data source.</p>
-<p>This property is not available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r5c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t17" headers="r1c1-t17">
-<p>&nbsp;&nbsp;Bind Parameters</p>
-</td>
-<td align="left" headers="r6c1-t17 r1c2-t17">
-<p>Control whether or not the query uses parameter binding.</p>
-<p>Note: This property applies when used in a Java SE environment.</p>
-<p>This property is not available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r6c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t17" headers="r1c1-t17">
-<p>EclipseLink Connection Pool</p>
-</td>
-<td align="left" headers="r7c1-t17 r1c2-t17">
-<p>Define the connection pool driver, URL, user name and password.</p>
-<p>These properties are note available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r7c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t17" headers="r1c1-t17">
-<p>&nbsp;&nbsp;Read Connection</p>
-</td>
-<td align="left" headers="r8c1-t17 r1c2-t17">
-<p>The maximum and minimum number of connections allowed in the JDBC read connection pool.</p>
-<p>Note: These properties apply when used in a Java SE environment.</p>
-<p>These properties are not available for projects using the Generic platform</p>
-</td>
-<td align="left" headers="r8c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t17" headers="r1c1-t17">
-<p>&nbsp;&nbsp;Write Connection</p>
-</td>
-<td align="left" headers="r9c1-t17 r1c2-t17">
-<p>The maximum and minimum number of connections allowed in the JDBC write connection pool.</p>
-<p>Note: These properties apply when used in a Java SE environment.</p>
-<p>These properties are not available for projects using the Generic platform</p>
-</td>
-<td align="left" headers="r9c1-t17 r1c3-t17"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
deleted file mode 100644
index 395b15aec7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
+++ /dev/null
@@ -1,153 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Customization</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customization" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAJAFEG" name="CIAJAFEG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customization</h1>
-<p>The following table lists the properties available in the Customization page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref222" name="sthref222"></a><a id="sthref223" name="sthref223"></a>
-<p class="titleintable">Properties of the Customization Page</p>
-<table class="Formal" title="Properties of the Customization Page" summary="This table lists the properties of the persistence.xml Editor&rsquo;s Customization page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-<th align="left" valign="bottom" id="r1c3-t18">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">
-<p>Weaving</p>
-</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">
-<p>Specifies if weaving of the entity classes is performed. The EclipseLink JPA persistence provider uses weaving to enhance JPA entities for such properties as lazy loading, change tracking, fetch groups, and internal optimizations. Select from the following options:</p>
-<ul>
-<li>
-<p><span class="bold">No Weaving</span></p>
-</li>
-<li>
-<p><span class="bold">Weave Dynamically</span></p>
-</li>
-<li>
-<p><span class="bold">Weave Statically</span> -- Use this option if you plan to execute your application outside of a Java EE 5 container in an environment that does not permit the use of <code>-javaagent:eclipselink.jar</code> on the JVM command line. This assumes that classes have already been statically woven. Run the static weaver on the classes before deploying them.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t18 r1c3-t18">
-<p>Weave Dynamically</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Weaving Lazy</p>
-</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">
-<p>Select this optoin to enable lazy weaving.</p>
-</td>
-<td align="left" headers="r3c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Weaving Fetch Groups</p>
-</td>
-<td align="left" headers="r4c1-t18 r1c2-t18">
-<p>Select this option to enable fetch groups through weaving. Set this option to false if:</p>
-<ul>
-<li>
-<p>There is no weaving.</p>
-</li>
-<li>
-<p>Classes should not be changed during weaving (for example, when debugging).</p>
-</li>
-</ul>
-<p>Set this property to false for platforms where it is not supported.</p>
-</td>
-<td align="left" headers="r4c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Weaving Change Tracking</p>
-</td>
-<td align="left" headers="r5c1-t18 r1c2-t18">
-<p>Select this option to use weaving to detect which fields or properties of the object change.</p>
-</td>
-<td align="left" headers="r5c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t18" headers="r1c1-t18">
-<p>&nbsp;&nbsp;Throw Exceptions</p>
-</td>
-<td align="left" headers="r6c1-t18 r1c2-t18">
-<p>Select this option to set EclipseLink to throw an exception or log a warning when it encounters a problem with any of the files listed in a <span class="bold">persistence.xml</span> file <code>&lt;mapping-file&gt;</code> element.</p>
-</td>
-<td align="left" headers="r6c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t18" headers="r1c1-t18">
-<p>Session Customizer</p>
-</td>
-<td align="left" headers="r7c1-t18 r1c2-t18">
-<p>Select a session customizer class: a Java class that implements the <code>eclipselink.tools.sessionconfiguration.SessionCustomizer</code> interface and provides a default (zero-argument) constructor. Use this class' <code>customize</code> method, which takes an <code>eclipselink.sessions.Session</code>, to programmatically access advanced EclipseLink session API.</p>
-</td>
-<td align="left" headers="r7c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t18" headers="r1c1-t18">
-<p>Descriptor Customizer</p>
-</td>
-<td align="left" headers="r8c1-t18 r1c2-t18">
-<p>Select an EclipseLink descriptor customizer class&ndash;a Java class that implements the <code>eclipselink.tools.sessionconfiguration.DescriptorCustomizer</code> interface and provides a default (zero-argument) constructor. Use this class's <code>customize</code> method, which takes an <code>eclipselink.descriptors.ClassDescriptor</code>, to programmatically access advanced EclipseLink descriptor and mapping API for the descriptor associated with the JPA entity named <code>&lt;ENTITY&gt;</code>.</p>
-</td>
-<td align="left" headers="r8c1-t18 r1c3-t18"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>The following table lists the properties of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
deleted file mode 100644
index 391d913f21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
+++ /dev/null
@@ -1,157 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Caching</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Caching" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABEDCH" name="CIABEDCH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Caching</h1>
-<p>This table lists the properties of the Caching page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref224" name="sthref224"></a><a id="sthref225" name="sthref225"></a>
-<p class="titleintable">Properties of the Caching Page</p>
-<table class="Formal" title="Properties of the Caching Page" summary="This table lists the properties of the persistence.xml&rsquo;s Caching page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t20">Property</th>
-<th align="left" valign="bottom" id="r1c2-t20">Description</th>
-<th align="left" valign="bottom" id="r1c3-t20">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t20" headers="r1c1-t20">
-<p>Default Cache Type</p>
-</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">
-<p>Select one of the following as the Default Cache Type:</p>
-<ul>
-<li>
-<p><span class="bold">Soft with Weak Subcache</span>&ndash;This option is similar to <span class="bold">Weak with Hard Subcache</span> except that it maintains a most frequently used subcache that uses soft references. The size of the subcache is proportional to the size of the identity map. The subcache uses soft references to ensure that these objects are garbage-collected only if the system is low on memory.</p>
-<p>Use this identity map in most circumstances as a means to control memory used by the cache.</p>
-</li>
-<li>
-<p><span class="bold">Week with Hard Subcache</span>&ndash;This option is similar to <span class="bold">Soft with Weak</span> subcache except that it maintains a most frequently used subcache that uses hard references. Use this identity map if soft references are not suitable for your platform.</p>
-</li>
-<li>
-<p><span class="bold">Weak</span>&ndash;This option is similar to <span class="bold">Full</span>, except that objects are referenced using weak references. This option uses less memory than <span class="bold">Full</span>, allows complete garbage collection and provides full caching and guaranteed identity.</p>
-<p>Use this identity map for transactions that, once started, stay on the server side.</p>
-</li>
-<li>
-<p><span class="bold">Soft</span>&ndash;This option is similar to <span class="bold">Weak</span> except that the map holds the objects using soft references. This identity map enables full garbage collection when memory is low. It provides full caching and guaranteed identity.</p>
-</li>
-<li>
-<p><span class="bold">Full</span>&ndash;This option provides full caching and guaranteed identity: all objects are cached and not removed.</p>
-<p>Note: This process may be memory-intensive when many objects are read.</p>
-</li>
-<li>
-<p><span class="bold">None</span>&ndash;This option does not preserve object identity and does not cache objects.This option is not recommended.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t20 r1c3-t20">
-<p>Weak with hard subcache</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">
-<p>Default Cache Size</p>
-</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">
-<p>Set the size of the cache.</p>
-</td>
-<td align="left" headers="r3c1-t20 r1c3-t20">
-<p>1000</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">
-<p>Default Shared Cache</p>
-</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">
-<p>Specfies if cached instances should be in the shared cache or in a client isolated cache.</p>
-</td>
-<td align="left" headers="r4c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t20" headers="r1c1-t20">
-<p>Entity Caching</p>
-</td>
-<td align="left" headers="r5c1-t20 r1c2-t20">
-<p>Specify the entity.</p>
-</td>
-<td align="left" headers="r5c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t20" headers="r1c1-t20">
-<p>&nbsp;&nbsp;Cache Type</p>
-</td>
-<td align="left" headers="r6c1-t20 r1c2-t20">
-<p>Select a cache type. See <span class="italic">Default Cache</span></p>
-</td>
-<td align="left" headers="r6c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t20" headers="r1c1-t20">
-<p>&nbsp;&nbsp;Cache Size</p>
-</td>
-<td align="left" headers="r7c1-t20 r1c2-t20">
-<p>Set the size of the cache.</p>
-</td>
-<td align="left" headers="r7c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t20" headers="r1c1-t20">
-<p>&nbsp;&nbsp;Shared Cache</p>
-</td>
-<td align="left" headers="r8c1-t20 r1c2-t20">
-<p>See <span class="italic">Default Shared Cache</span>.</p>
-</td>
-<td align="left" headers="r8c1-t20 r1c3-t20"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
deleted file mode 100644
index 693ad1dd65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
+++ /dev/null
@@ -1,217 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Logging</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Logging" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABGHHI" name="CIABGHHI"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Logging</h1>
-<p>This table lists the properties of the Logging page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref226" name="sthref226"></a><a id="sthref227" name="sthref227"></a>
-<p class="titleintable">Properties of the Logging Page</p>
-<table class="Formal" title="Properties of the Logging Page" summary="This table lists the properties of the Logging page of the persistence.xml Editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t23">Property</th>
-<th align="left" valign="bottom" id="r1c2-t23">Description</th>
-<th align="left" valign="bottom" id="r1c3-t23">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t23" headers="r1c1-t23">
-<p>Logging Level</p>
-</td>
-<td align="left" headers="r2c1-t23 r1c2-t23">
-<p>Specifies the amount and detail of log output by selecting the log level (in ascending order of information):</p>
-<p>The following are the valid values for the <code>java.util.logging.Level</code>:</p>
-<ul>
-<li>
-<p><span class="bold">OFF</span>&ndash;disables logging</p>
-</li>
-<li>
-<p><span class="bold">SEVERE</span>&ndash;logs exceptions indicating TopLink cannot continue, as well as any exceptions generated during login. This includes a stack trace.</p>
-</li>
-<li>
-<p><span class="bold">WARNING</span>&ndash;logs exceptions that do not force TopLink to stop, including all exceptions not logged with severe level. This does not include a stack trace.</p>
-</li>
-<li>
-<p><span class="bold">INFO</span>&ndash;logs the login/logout per sever session, including the user name. After acquiring the session, detailed information is logged.</p>
-</li>
-<li>
-<p><span class="bold">CONFIG</span>&ndash;logs only login, JDBC connection, and database information.</p>
-</li>
-<li>
-<p><span class="bold">FINE</span>&ndash;logs SQL.</p>
-</li>
-<li>
-<p><span class="bold">FINER</span>&ndash;similar to warning. Includes stack trace.</p>
-</li>
-<li>
-<p><span class="bold">FINEST</span>&ndash;includes additional low level information.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.level" value="INFO"/&gt;
-</pre></td>
-<td align="left" headers="r2c1-t23 r1c3-t23">
-<p>Info</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;TimeStamp</p>
-</td>
-<td align="left" headers="r3c1-t23 r1c2-t23">
-<p>Control whether the timestamp is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a timestamp.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a timestamp.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.timestamp" value="false"/&gt;
-</pre></td>
-<td align="left" headers="r3c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;Thread</p>
-</td>
-<td align="left" headers="r4c1-t23 r1c2-t23">
-<p>Control whether a thread identifier is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a thread identifier.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a thread identifier.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;Session</p>
-</td>
-<td align="left" headers="r5c1-t23 r1c2-t23">
-<p>Control whether an EclipseLink session identifier is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a EclipseLink session identifier.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a EclipseLink session identifier.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.session" value="false"/&gt;
-</pre></td>
-<td align="left" headers="r5c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t23" headers="r1c1-t23">
-<p>&nbsp;&nbsp;Exceptions</p>
-</td>
-<td align="left" headers="r6c1-t23 r1c2-t23">
-<p>Control whether the exceptions thrown from within the TopLink code are logged prior to returning the exception to the calling application. Ensures that all exceptions are logged and not masked by the application code.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log all exceptions.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log exceptions.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.exceptions" value="true"/&gt;
-</pre></td>
-<td align="left" headers="r6c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t23" headers="r1c1-t23">
-<p>Logger</p>
-</td>
-<td align="left" headers="r7c1-t23 r1c2-t23">
-<p>Select the type of logger to use:</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">DefaultLogger</span>&ndash;the EclipseLink native logger <code>eclipselink.logging.DefaultSessionLog</code>.</p>
-</li>
-<li>
-<p><span class="bold">JavaLogger</span>&ndash;the <code>java.util.logging</code> logger <code>eclipselink.logging.JavaLog</code>.</p>
-</li>
-<li>
-<p><span class="bold">ServerLogger</span>&ndash;the <code>java.util.logging</code> logger <code>eclipselink.platform.server.ServerLog</code>. Integrates with the application server's logging as define in the <code>eclipselink.platform.server.ServerPlatform.</code></p>
-</li>
-<li>
-<p>Fully qualified class name of a custom logger. The custom logger must implement the <code>eclipselink.logging.SessionLog</code> interface.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.logger" value="acme.loggers.MyCustomLogger" /&gt;
-</pre></td>
-<td align="left" headers="r7c1-t23 r1c3-t23">
-<p>DefaultLogger</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
deleted file mode 100644
index 076e38dcee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
+++ /dev/null
@@ -1,124 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Options</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Options" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFJCHE" name="CIAFJCHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Options</h1>
-<p>This table lists the properties of the Options page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref228" name="sthref228"></a><a id="sthref229" name="sthref229"></a>
-<p class="titleintable">Properties of the Options Page</p>
-<table class="Formal" title="Properties of the Options Page" summary="" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t25">Property</th>
-<th align="left" valign="bottom" id="r1c2-t25">Description</th>
-<th align="left" valign="bottom" id="r1c3-t25">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t25" headers="r1c1-t25">
-<p>Session Name</p>
-</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">
-<p>Specify the name by which the EclipseLink session is stored in the static session manager. Use this option if you need to access the EclipseLink shared session outside of the context of the JPA or to use a pre-existing EclipseLink session configured through a EclipseLink <code>sessions.xml</code> file</p>
-<p>Valid values: a valid EclipseLink session name that is unique in a server deployment.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.session-name" value="MySession"/&gt;
-</pre></td>
-<td align="left" headers="r2c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">
-<p>Sessions XML</p>
-</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">
-<p>Specify persistence information loaded from the EclipseLink session configuration file (<code>sessions.xml</code>).</p>
-<p>You can use this option as an alternative to annotations and deployment XML. If you specify this property, TopLink will override all class annotation and the object relational mapping from the <code>persistence.xml</code>, as well as <code>ORM.xml</code> and other mapping files, if present. .</p>
-<p>Indicate the session by setting the <code>eclipselink.session-name</code> property.</p>
-<p>Note: If you do not specify the value for this property, <code>sessions.xml</code> file will not be used.</p>
-<p>Valid values: the resource name of the sessions XML file.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="toplink.session-xml" value="mysession.xml"/&gt;
-</pre></td>
-<td align="left" headers="r3c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">
-<p>Target Database</p>
-</td>
-<td align="left" headers="r4c1-t25 r1c2-t25"><br /></td>
-<td align="left" headers="r4c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t25" headers="r1c1-t25">
-<p>Event Listener</p>
-</td>
-<td align="left" headers="r5c1-t25 r1c2-t25">
-<p>Specify a descriptor event listener to be added during bootstrapping.</p>
-<p>Valid values: qualified class name for a class that implements the <code>eclipselink.sessions.SessionEventListener</code> interface.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.session-event-listener" value="mypackage.MyClass.class"/&gt;
-</pre></td>
-<td align="left" headers="r5c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t25" headers="r1c1-t25">
-<p>Include Descriptor Queries</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c2-t25">
-<p>Enable or disable the default copying of all named queries from the descriptors to the session. These queries include the ones defined using EclipseLink API, descriptor amendment methods, and so on.</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c3-t25"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
deleted file mode 100644
index 183e31790b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Schema Generation</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Schema Generation" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACCFCB" name="CIACCFCB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Schema Generation</h1>
-<p>This table lists the properties of the Schema Generation page of the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref230" name="sthref230"></a><a id="sthref231" name="sthref231"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table lists the properties of the persistence.xml Editor&rsquo;s Schema Generation page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t27">Property</th>
-<th align="left" valign="bottom" id="r1c2-t27">Description</th>
-<th align="left" valign="bottom" id="r1c3-t27">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t27" headers="r1c1-t27">
-<p>DDL Generation Type</p>
-</td>
-<td align="left" headers="r2c1-t27 r1c2-t27">
-<p>Select the type of DDL generation:</p>
-<ul>
-<li>
-<p><span class="bold">None</span> -- Do not generate DDL; no schema is generated.</p>
-</li>
-<li>
-<p><span class="bold">Create Tables</span> -- Create DDL for non-existent tables; leave existing tables unchanged.</p>
-</li>
-<li>
-<p><span class="bold">Drop and Create Tables</span> -- Create DDL for all tables; drop all existing tables.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t27 r1c3-t27">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t27" headers="r1c1-t27">
-<p>Output Mode</p>
-</td>
-<td align="left" headers="r3c1-t27 r1c2-t27">
-<p>Select the DDL generation target:</p>
-<ul>
-<li>
-<p><span class="bold">Both</span> -- Generate SQL files and execute them on the database.</p>
-</li>
-<li>
-<p><span class="bold">Database</span> -- Execute SQL on the database only (do not generate SQL files).</p>
-</li>
-<li>
-<p><span class="bold">SQL Script</span> -- Generate SQL files only (do not execute them on the database).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t27 r1c3-t27"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t27" headers="r1c1-t27">
-<p>DDL Generation Location</p>
-</td>
-<td align="left" headers="r4c1-t27 r1c2-t27">
-<p>Specify where EclipseLink writes DDL output. Specify a file specification to a directory in which you have write access. The file specification may be relative to your current working directory or absolute. If it does not end in a file separator, then EclipseLink appends one that is valid for your operating system.</p>
-</td>
-<td align="left" headers="r4c1-t27 r1c3-t27"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t27" headers="r1c1-t27">
-<p>Create DDL File Name</p>
-</td>
-<td align="left" headers="r5c1-t27 r1c2-t27">
-<p>Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for creating tables for JPA entities. Specify a file name valid for your operating system.</p>
-</td>
-<td align="left" headers="r5c1-t27 r1c3-t27">
-<p>createDDL.jdbc</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t27" headers="r1c1-t27">
-<p>Drop DDL File Name</p>
-</td>
-<td align="left" headers="r6c1-t27 r1c2-t27">
-<p>Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for dropping tables for JPA entities.</p>
-</td>
-<td align="left" headers="r6c1-t27 r1c3-t27">
-<p>dropDDL.jdbc</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm
deleted file mode 100644
index 000c41403c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Properties</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Properties" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHJDFF" name="CIAHJDFF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Properties</h1>
-<p>This page enables you to add or remove the vendor-specific <code>&lt;properties&gt;</code> elements of persistence.xml.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
deleted file mode 100644
index 2569ec9ef5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:51 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Source</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Source" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHCJAH" name="CIAHCJAH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Source</h1>
-<p>Using this page, you can manually edit the persistence.xml file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for additional information.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm
deleted file mode 100644
index 72bfc39bb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Preferences</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Preferences" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDEIEE" name="CACDEIEE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Preferences</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
deleted file mode 100644
index 09d9498ec7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Dialogs</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dialogs" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGEJDA" name="CACGEJDA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dialogs</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a></p>
-</li>
-<li>
-<p><a href="reference030.htm#CACCGEHC">Edit Join Columns Dialog</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm
deleted file mode 100644
index 0123de3e64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Edit Join Columns Dialog</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Edit Join Columns Dialog" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCGEHC" name="CACCGEHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Edit Join Columns Dialog</h1>
-<p>Use the <span class="gui-object-title">Join Columns</span> dialog to create or modify the join tables and columns in relationship mappings.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Join Columns</span> dialog.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Join Columns dialog." summary="This table describes the options on the Join Columns dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t30">Property</th>
-<th align="left" valign="bottom" id="r1c2-t30">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t30" headers="r1c1-t30">Name</td>
-<td align="left" headers="r2c1-t30 r1c2-t30">Name of the joint table column that contains the foreign key column.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t30" headers="r1c1-t30">Referenced Column Name</td>
-<td align="left" headers="r3c1-t30 r1c2-t30">Name of the database column that contains the foreign key reference for the entity relationship.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference014.htm#CACBAEBC">Join Table Information</a><br />
-<a href="reference015.htm#CACFCEJC">Join Columns Information</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
deleted file mode 100644
index c9d1e3ec95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Icons and buttons</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons and buttons" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDHCIA" name="CACDHCIA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Icons and buttons</h1>
-<p>This section includes information on each of the icons and buttons used in the Dali OR Mapping Tool.</p>
-<ul>
-<li>
-<p><a href="reference032.htm#CACGEACG">Icons</a></p>
-</li>
-<li>
-<p><a href="reference033.htm#CACDJCEI">Buttons</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm
deleted file mode 100644
index fc1cd84f6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Icons</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGEACG" name="CACGEACG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Icons</h1>
-<p>The following icons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the icons used in the Dali plug-in." summary="This table describes the icons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t31">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t31">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t31" headers="r1c1-t31"><img src="img/new_icon_mappedentity.png" alt="" title="" /><br /></td>
-<td align="left" headers="r2c1-t31 r1c2-t31"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t31" headers="r1c1-t31"><img src="img/new_icon_embeddableentitymapping.png" alt="Embeddable entity icon" title="Embeddable entity icon" /><br /></td>
-<td align="left" headers="r3c1-t31 r1c2-t31"><a href="tasks007.htm#BABFEICE">Embeddable</a> entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t31" headers="r1c1-t31"><img src="img/new_icon_mappedsuperclass.png" alt="Mapped superclass icon" title="Mapped superclass icon" /><br /></td>
-<td align="left" headers="r4c1-t31 r1c2-t31"><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t31" headers="r1c1-t31"><img src="img/new_icon_basicmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r5c1-t31 r1c2-t31"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t31" headers="r1c1-t31"><img src="img/new_icon_embeddedidmapping.png" alt="Embedded mapping icon" title="Embedded mapping icon" /><br /></td>
-<td align="left" headers="r6c1-t31 r1c2-t31"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t31" headers="r1c1-t31"><img src="img/new_icon_embeddedmapping.png" alt="Embedded ID mapping icon" title="Embedded ID mapping icon" /><br /></td>
-<td align="left" headers="r7c1-t31 r1c2-t31"><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t31" headers="r1c1-t31"><img src="img/new_icon_idmapping.png" alt="ID mapping icon" title="ID mapping icon" /><br /></td>
-<td align="left" headers="r8c1-t31 r1c2-t31"><a href="tasks013.htm#BABGCBHG">ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t31" headers="r1c1-t31"><img src="img/new_icon_manytomanymapping.png" alt="Many-to-many mapping icon" title="Many-to-many mapping icon" /><br /></td>
-<td align="left" headers="r9c1-t31 r1c2-t31"><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t31" headers="r1c1-t31"><img src="img/new_icon_manytoonemapping.png" alt="Many-to-one mapping icon." title="Many-to-one mapping icon." /><br /></td>
-<td align="left" headers="r10c1-t31 r1c2-t31"><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t31" headers="r1c1-t31"><img src="img/new_icon_onetomanymapping.png" alt="One-to-many mapping icon" title="One-to-many mapping icon" /><br /></td>
-<td align="left" headers="r11c1-t31 r1c2-t31"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t31" headers="r1c1-t31"><img src="img/new_icon_onetoonemapping.png" alt="One-to-one mapping icon." title="One-to-one mapping icon." /><br /></td>
-<td align="left" headers="r12c1-t31 r1c2-t31"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t31" headers="r1c1-t31"><img src="img/new_icon_transientmapping.png" alt="Transient mapping icon." title="Transient mapping icon." /><br /></td>
-<td align="left" headers="r13c1-t31 r1c2-t31"><a href="tasks018.htm#BABHFHEI">Transient mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t31" headers="r1c1-t31"><img src="img/new_icon_versionmapping.png" alt="Version mapping icon." title="Version mapping icon." /><br /></td>
-<td align="left" headers="r14c1-t31 r1c2-t31"><a href="tasks019.htm#BABHIBII">Version mapping</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference031.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
deleted file mode 100644
index 912e486719..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Buttons</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDJCEI" name="CACDJCEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Buttons</h1>
-<p>The following buttons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the buttons used in the Dali plug-in." summary="This table describes the buttons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t32">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t32">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t32" headers="r1c1-t32"><img src="img/new_jpa_perspective_button.png" alt="The JPA Perspective icon" title="The JPA Perspective icon" /><br /></td>
-<td align="left" headers="r2c1-t32 r1c2-t32">JPA Development perspective</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference031.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm
deleted file mode 100644
index cf677e30bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference034.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Dali Developer Documentation</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali Developer Documentation" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBBDIB" name="CACBBDIB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dali Developer Documentation</h1>
-<p><a id="sthref246" name="sthref246"></a><a id="sthref247" name="sthref247"></a><a id="sthref248" name="sthref248"></a>Additional Dali documentation is available online at:</p>
-<p><code><a href="http://wiki.eclipse.org/index.php/Dali_Developer_Documentation">http://wiki.eclipse.org/index.php/Dali_Developer_Documentation</a></code></p>
-<p>This developer documentation includes information about:</p>
-<ul>
-<li>
-<p>Dali architecture</p>
-</li>
-<li>
-<p>Plugins that comprise the Dali JPA Eclipse feature</p>
-</li>
-<li>
-<p>Extension points</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
deleted file mode 100644
index 2fde1e2c47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Adding persistence to a class</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Adding persistence to a class" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHICAI" name="BABHICAI"></a></p>
-<div class="sect1">
-<h1>Adding persistence to a class</h1>
-<p><a id="sthref54" name="sthref54"></a><a id="sthref55" name="sthref55"></a><a id="sthref56" name="sthref56"></a>You can make a Java class into one of the following persistent types:</p>
-<ul>
-<li>
-<p><a href="tasks006.htm#BABGBIEE">Entity</a></p>
-</li>
-<li>
-<p><a href="tasks007.htm#BABFEICE">Embeddable</a></p>
-</li>
-<li>
-<p><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
deleted file mode 100644
index ba760f6083..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Specifying additional tables</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying additional tables" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHGBIEI" name="CIHGBIEI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Specifying additional tables</h1>
-<p>Add a secondary table annotation to an entity if its data is split across more more than one table.</p>
-<p>To add a secondary table to the entity,</p>
-<ol start="1">
-<li>
-<p>Select the entity in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Secondary Tables</span> information.</p>
-<div class="figure"><a id="sthref79" name="sthref79"></a>
-<p class="titleinfigure">Specifying Secondary Tables</p>
-<img src="img/secondary_tables.png" alt="Secondary Tables area on the JPA Details view." title="Secondary Tables area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Click <span class="bold">Add</span> to associate an additional table with the entity. The Edit Secondary Table dialog appears</p>
-</li>
-<li>
-<p>Select the <span class="bold">Name</span>, <span class="bold">Catalog</span>, and <span class="bold">Schema</span> of the additional table to associate with the entity.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations the entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA"
-
-</pre>
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
deleted file mode 100644
index 1a7ad4a032..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a new JPA project</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHHEJCJ" name="CIHHEJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref25" name="sthref25"></a><a id="sthref26" name="sthref26"></a>Use this procedure to create a new JPA project.</p>
-<ol start="1">
-<li>
-<p>From the Navigator or Package Explorer, select <span class="bold">File &gt; New &gt; Project</span>. The Select a wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also select the JPA perspective and then select <span class="bold">File &gt; New &gt; JPA Project</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="figure"><a id="sthref27" name="sthref27"></a>
-<p class="titleinfigure">Selecting the Create a JPA Project wizard</p>
-<img src="img/select_a_wizard_jpa_project.png" alt="The Select a Wizard dialog with JPA project selected." title="The Select a Wizard dialog with JPA project selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JPA Project</span> and then click <span class="bold">Next</span>. The <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> appears.</p>
-<div class="figure"><a id="sthref28" name="sthref28"></a>
-<p class="titleinfigure">The JPA Project Page</p>
-<img src="img/new_jpa_project_task.png" alt="The JPA Project page of the Create a JPA Project wizard." title="The JPA Project page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> to specify the project name and location, target runtime, and pre-defined configuration.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Target Runtime is not required for Java SE development.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div class="figure"><a id="sthref29" name="sthref29"></a>
-<p class="titleinfigure">The JPA Facet Page</p>
-<img src="img/new_jpa_facet_task.png" alt="The JPA Facet page of the Create a JPA Project wizard." title="The JPA Facet page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, database connection, and JPA implementation library.</p>
-<p>If Dali derives the incorrect schema, select <span class="bold">Override the Default Schema for Connection</span>. Using this option, you can select a development time schema for defaults and validation.</p>
-<p>If you clear the <span class="bold">Create orm.xml</span> option (which is selected by default), you can later add a mapping file to the project using the <a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the server runtime does not provide a JPA implementation, you must explicitly select a JPA implementation library.
-<p>To insure the portability of your application, you must explicitly list the managed persistence classes that are included in the persistence unit. If the server supports EJB 3.0, the persistent classes will be discovered automatically.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. You should now open the <a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a><br />
-<a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm
deleted file mode 100644
index 299aedd3db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:52 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generate Entities from Tables dialog</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Entities from Tables dialog" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDAFJD" name="CACDAFJD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Entities from Tables dialog</h1>
-<p><a id="sthref241" name="sthref241"></a><a id="sthref242" name="sthref242"></a><a id="sthref243" name="sthref243"></a>Use the <span class="gui-object-title">Generate Entities</span> dialog to create Java persistent entities from your database tables and columns.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Generate Entities dialog</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Generate Entities dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t29">Property</th>
-<th align="left" valign="bottom" id="r1c2-t29">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t29" headers="r1c1-t29">Source Folder</td>
-<td align="left" headers="r2c1-t29 r1c2-t29">Enter a project folder name in which to generate the Java persistent entities, or click <span class="bold">Browse</span> to select an existing folder.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t29" headers="r1c1-t29">Package</td>
-<td align="left" headers="r3c1-t29 r1c2-t29">Enter a package name in which to generate the Java persistent entities, or click <span class="bold">Browse</span> to select an existing package.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t29" headers="r1c1-t29">Synchronize Classes in persistence.xml</td>
-<td align="left" headers="r4c1-t29 r1c2-t29">Specify if Dali should update the persistence.xml file to include the generated classes.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t29" headers="r1c1-t29">Tables</td>
-<td align="left" headers="r5c1-t29 r1c2-t29">Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection that you defined in the <a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="tasks020.htm#BABBAGFI">Generating entities from tables</a></p>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
deleted file mode 100644
index d4e124b0ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Specifying entity inheritance</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying entity inheritance" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHCCCJD" name="CIHCCCJD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Specifying entity inheritance</h1>
-<p><a id="sthref80" name="sthref80"></a><a id="sthref81" name="sthref81"></a>An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.</p>
-<p>Use this procedure to specify inheritance (<code>@Inheritance)</code> for an existing entity (<code>@Entity</code>):</p>
-<ol start="1">
-<li>
-<p>Select the entity in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Inheritance</span> information.</p>
-<div class="figure"><a id="sthref82" name="sthref82"></a>
-<p class="titleinfigure">Specifying Inheritance</p>
-<img src="img/inheritance_tab.png" alt="Selecting the Inheritance area on the JPA Details view." title="Selecting the Inheritance area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>In the <span class="bold">Strategy</span> list, select one of the following the inheritance strategies:</p>
-<ul>
-<li>
-<p>A single table (default)</p>
-</li>
-<li>
-<p>Joined table</p>
-</li>
-<li>
-<p>One table per class</p>
-</li>
-</ul>
-</li>
-<li>
-<p>Use the following table to complete the remaining fields on the tab. See <a href="reference012.htm#CACFHGHE">"Inheritance information"</a> for additional details.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14"><a id="sthref83" name="sthref83"></a><a id="sthref84" name="sthref84"></a>Discriminator Column</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.
-<p>This field corresponds to the <code>@DiscriminatorColumn</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Discriminator Type</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">Set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r3c1-t14 r1c3-t14">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14"><a id="sthref85" name="sthref85"></a><a id="sthref86" name="sthref86"></a>Discriminator Value</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.
-<p>This field corresponds to the <code>@DiscriminatorValue</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Override Default</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">Use this field to specify custom primary key join columns.
-<p>This field corresponds to the <code>@PrimaryKeyJoinClumn</code> annotation.</p>
-</td>
-<td align="left" headers="r5c1-t14 r1c3-t14"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations the entity field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Inheritance(strategy=InheritanceType.<span class="italic">&lt;INHERITANCE_STRATEGY&gt;</span>)
-@DiscriminatorColumn(name="<span class="italic">&lt;DISCRIMINATOR_COLUMN&gt;</span>",
- discriminatorType=<span class="italic">&lt;DISCRIMINATOR_TYPE&gt;</span>)
-@DiscriminatorValue(value-"<span class="italic">&lt;DISCRIMINATOR_VALUE&gt;</span>")
-@PrimaryKeyJoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName = "<span class="italic">&lt;REFERENCED_COLUMN_NAME&gt;</span>")
-
-</pre>
-<p><a id="sthref87" name="sthref87"></a><a id="sthref88" name="sthref88"></a><a id="sthref89" name="sthref89"></a>The following figures illustrates the different inheritance strategies.</p>
-<div class="figure"><a id="sthref90" name="sthref90"></a>
-<p class="titleinfigure">Single Table Inheritance</p>
-<img src="img/inheritance_single.png" alt="This figure illustrates entity inheritance in a single table." title="This figure illustrates entity inheritance in a single table." /><br /></div>
-<!-- class="figure" -->
-<div class="figure"><a id="sthref91" name="sthref91"></a>
-<p class="titleinfigure"><a id="sthref92" name="sthref92"></a><a id="sthref93" name="sthref93"></a>Joined Table Inheritance</p>
-<img src="img/inheritance_join.png" alt="This figure illustrates a joined subclass inheritance strategy." title="This figure illustrates a joined subclass inheritance strategy." /><br /></div>
-<!-- class="figure" -->
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
deleted file mode 100644
index 76780e6360..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Managing the orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDGDCD" name="CIHDGDCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref46" name="sthref46"></a>Managing the orm.xml file</h1>
-<p>When creating a JPA project, (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>) you can also create the <code>orm.xml</code> file that defines the mapping metadata and defaults.</p>
-<p><a id="sthref47" name="sthref47"></a>Eclipse creates the <code>META-INF\orm.xml</code> file in your project's directory:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;persistence version="<span class="italic">&lt;PERSISTENCE_VERSION&gt;</span>"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
- &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>"&gt;
- &lt;provider="<span class="italic">&lt;PERSISTENCE_PROVIDER&gt;</span>" /&gt;
- &lt;/persistence-unit&gt;
-&lt;/persistence&gt;
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks005.htm#CIHBCDCE">Working with orm.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
deleted file mode 100644
index 8be90a2e23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ /dev/null
@@ -1,212 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Managing the persistence.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDAJID" name="CIHDAJID"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref35" name="sthref35"></a>Managing the persistence.xml file</h1>
-<p><a id="sthref36" name="sthref36"></a>When you create a project, Eclipse creates the <code>META-INF\persistence.xml</code> file in the project's directory.</p>
-<p>You can create a stub <code>persistence.xml</code> file in the META-INF directory when you create a JPA project (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>). You can manage this file either through the XML editor (see <a href="tasks002.htm#CIHEJAIE">"Using the XML Editor to edit the persistence.xml file"</a>) or through the <a href="reference018.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-In additon to the General, Connection, Properties and Source pages, the persistence.xml Editor pages for projects that use the EclipseLink platform include the following:
-<ul>
-<li>
-<p><a href="reference021.htm#CIAJAFEG">Customization</a></p>
-<p>Use this page to define change-tracking and session customizer-related properties.</p>
-</li>
-<li>
-<p><a href="reference022.htm#CIABEDCH">Caching</a></p>
-<p>Use this page to define caching properties.</p>
-</li>
-<li>
-<p><a href="reference023.htm#CIABGHHI">Logging</a></p>
-<p>Use this page to define logging properties.</p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAFJCHE">Options</a></p>
-<p>Use this page to define session and target database properties.</p>
-</li>
-<li>
-<p><a href="reference025.htm#CIACCFCB">Schema Generation</a></p>
-<p>Use this page to define DDL-related properties.</p>
-</li>
-</ul>
-<p>For projects using the EclipseLink platform, the Connections page also includes JDBC connection pool properties.</p>
-<p>If the project uses the Generic platform, then only the General, Connection, Properties and Source pages are available.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>To use the <code>persistence.xml</code> Editor:</p>
-<ol start="1">
-<li>
-<p>Open the <code>peristence.xml</code> file. The <a href="reference019.htm#CIACIFGJ">General</a> page of the editor appears.</p>
-</li>
-<li>
-<p>Use the General page to define the <code>persistence.xml</code> files <code>&lt;persistent-unit&gt;</code>-related attributes as well as the <code>&lt;provider&gt;</code>, and <code>&lt;class&gt;</code> elements (described in the following table).</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-The persistence.xml Editor's Source page enables you to view and edit the raw XML file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="inftblinformal">
-<table class="Informal" summary="This table lists the properties of the persistence.xml editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Element Defined</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Name</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Enter the name of the persistence unit.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8"><code>&lt;persistence-unit name = "&lt;Name&gt;"&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">Persistence Provider</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Enter the name of the persistence provider.</td>
-<td align="left" headers="r3c1-t8 r1c3-t8"><code>&lt;provider&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Description</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Enter a description for this persistence unit. This is an optional property.</td>
-<td align="left" headers="r4c1-t8 r1c3-t8"><code>&lt;description&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8">Managed Classes</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Add or remove the classes managed through the persistence unit.</td>
-<td align="left" headers="r5c1-t8 r1c3-t8"><code>&lt;class&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">&nbsp;&nbsp;Exclude Unlisted Classes</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Select to include all annotated entity classes in the root of the persistence unit.</td>
-<td align="left" headers="r6c1-t8 r1c3-t8"><code>&lt;exclude-unlisted-classes&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t8" headers="r1c1-t8">XML Mapping Files</td>
-<td align="left" headers="r7c1-t8 r1c2-t8">Add or remove the object/relational mapping XML files define the classes managed through the persistence unit.</td>
-<td align="left" headers="r7c1-t8 r1c3-t8"><code>&lt;mapping-file&gt;</code></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></li>
-<li>
-<p>Use the <a href="reference020.htm#CIAFFJIE">Connection</a> page to define the <code>&lt;jta-data-source&gt;</code> and <code>&lt;non-jta-data-source&gt;</code> elements as follows:</p>
-<p>To configure the JTA (Java Transaction API) source used by the persistence provider:</p>
-<ol start="1">
-<li>
-<p>Select <span class="bold">JTA</span> from the Transaction Type list.</p>
-</li>
-<li>
-<p>Enter the global JNDI name of the data source.</p>
-</li>
-</ol>
-<p>To configure a non-JTA data source:</p>
-<ol start="1">
-<li>
-<p>Select <span class="bold">Resource Local</span> from the Transaction Type list.</p>
-</li>
-<li>
-<p>Enter the global JNDI name of the data source.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Select <span class="bold">Default()</span> to use the data source provided by the container.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-</li>
-<li>
-<p>Use the table in the Properties page to set the vendor-specific <code>&lt;properties&gt;</code> element.</p>
-<p>To add <code>&lt;property&gt;</code> elements:</p>
-<ol start="1">
-<li>
-<p>Click <span class="bold">Add</span>.</p>
-</li>
-<li>
-<p>Enter the <code>&lt;name&gt;</code> and <code>&lt;value&gt;</code> attributes for the <code>&lt;property&gt;</code> element using the table's Name and Value fields.</p>
-</li>
-</ol>
-<p>To remove a <code>&lt;property&gt;</code> element, select a defined property in the table and then click <span class="bold">Remove</span>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the project uses the EclipseLink platform, the connection page also includes parameters for JDBC connection pooling.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference018.htm#CIACCHID">persistence.xml Editor</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks002.htm#CIHEJAIE">Using the XML Editor to edit the persistence.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
deleted file mode 100644
index 8dc785df3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapping an entity</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDGBIJ" name="BABDGBIJ"></a></p>
-<div class="sect1">
-<h1>Mapping an entity</h1>
-<p>Dali supports the following mapping types for Java persistent entities:</p>
-<ul>
-<li>
-<p><a href="tasks010.htm#BABBABCE">Basic mapping</a></p>
-</li>
-<li>
-<p><a href="tasks011.htm#BABCBHDF">Embedded mapping</a></p>
-</li>
-<li>
-<p><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks013.htm#BABGCBHG">ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks018.htm#BABHFHEI">Transient mapping</a></p>
-</li>
-<li>
-<p><a href="tasks019.htm#BABHIBII">Version mapping</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
deleted file mode 100644
index 31d4dd2087..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Tasks</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tasks" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref24" name="sthref24"></a></p>
-<h1>Tasks</h1>
-<p>This section includes detailed step-by-step procedures for accessing the Dali OR mapping tool functionality.</p>
-<ul>
-<li>
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="tasks001.htm#BABFBJBG">Creating a JPA Entity</a></p>
-</li>
-<li>
-<p><a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></p>
-</li>
-<li>
-<p><a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a></p>
-</li>
-<li>
-<p><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></p>
-</li>
-<li>
-<p><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></p>
-</li>
-<li>
-<p><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></p>
-</li>
-<li>
-<p><a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></p>
-</li>
-<li>
-<p><a href="tasks020.htm#BABBAGFI">Generating entities from tables</a></p>
-</li>
-<li>
-<p><a href="tasks022.htm#BABFAIBA">Validating mappings and reporting problems</a></p>
-</li>
-<li>
-<p><a href="tasks025.htm#BABDBCBI">Modifying persistent project properties</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
deleted file mode 100644
index 530bf91bba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
+++ /dev/null
@@ -1,156 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:42 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating a JPA Entity</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a JPA Entity" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFBJBG" name="BABFBJBG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref30" name="sthref30"></a>Creating a JPA Entity</h1>
-<p>Use this procedure to create a JPA entity:</p>
-<ol start="1">
-<li>
-<p>From the Navigator or Package Explorer, select the JPA project and then <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref31" name="sthref31"></a>
-<p class="titleinfigure">Selecting the Create a JPA Entity Wizard</p>
-<img src="img/select_a_wizard_entity.png" alt="The Select a Wizard dialog with Entity selected." title="The Select a Wizard dialog with Entity selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">Entity</span> and then click <span class="bold">Next</span>. The <a href="reference003.htm#CIAFEIGF">Entity Class page</a> appears.</p>
-<div class="figure"><a id="sthref32" name="sthref32"></a>
-<p class="titleinfigure">The Entity Class Page</p>
-<img src="img/create_jpa_entity_wizard.png" alt="The Entity Class page of the Create a JPA Entity wizard." title="The Entity Class page of the Create a JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>Complete this page as follows:</p>
-<ul>
-<li>
-<p>Select the JPA project in the Project field.</p>
-</li>
-<li>
-<p>In the Source Folder field, select, or enter, the location of the JPA project's src folder.</p>
-</li>
-<li>
-<p>Select, or enter, the name of the class package for this entity in the Java Package field.</p>
-</li>
-<li>
-<p>Enter the name of the Java class in the Class name field.</p>
-</li>
-<li>
-<p>If needed, enter, or select a superclass.</p>
-</li>
-<li>
-<p>If needed, complete the Inheritance section as follows (these properties are optional):</p>
-<ul>
-<li>
-<p>Accept the <span class="bold">Entity</span> option (the default) to create a Java class with the <code>@Entity</code> option.</p>
-</li>
-<li>
-<p>Alternatively, select <a href="tasks008.htm#BABDAGCI">Mapped superclass</a> (if you defined a super class).</p>
-</li>
-<li>
-<p>Select <span class="bold">Inheritance</span> and then select one of the JSR 220 inheritance mapping strategies (SINGLE_TABLE, TABLE_PER_CLASS, JOINED).</p>
-</li>
-<li>
-<p>Select <span class="bold">Add</span> to entity mappings in XML to create XML mappings in <code>orm.xml</code>, rather than annotations.</p>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-<li>
-<p>Click <span class="bold">Next</span> to proceed to the <a href="reference004.htm#CIADECIA">Entity Properties page</a> where you define the persistent fields for the entity.</p>
-<div class="figure"><a id="sthref33" name="sthref33"></a>
-<p class="titleinfigure">The Entity Properties Page</p>
-<img src="img/create_jpa_fields.png" alt="The Entity Properties page of the Create JPA Entity wizard." title="The Entity Properties page of the Create JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>Alternatively, click <span class="bold">Finish</span> to complete the entity.</p>
-</li>
-<li>
-<p>Complete the page as follows:</p>
-<ol start="1">
-<li>
-<p>If needed, enter a new name for the entity. Doing so results in adding a <code>name</code> attribute to the <code>@Entity</code> notation (<code>@Entity(name="EntityName")</code>).</p>
-</li>
-<li>
-<p>Accept <span class="bold">Use default</span> (the default setting) to use the default value for the name of the mapped table. Entering a different name results in adding the <code>@Table</code> notation with its <code>name</code> attribute defined as the new table (<code>@Table(name="TableName")</code>).</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Entity Name-related options are not available if you selected <a href="tasks008.htm#BABDAGCI">Mapped superclass</a> on the <a href="reference003.htm#CIAFEIGF">Entity Class page</a></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Add persistence fields to the entity by clicking <span class="bold">Add</span>. The Entity Fields dialog appears.</p>
-<div class="figure"><a id="sthref34" name="sthref34"></a>
-<p class="titleinfigure">The Entity Fields Dialog</p>
-<img src="img/jpa_wizard_create_fields.png" alt="The Entity Fields dialog." title="The Entity Fields dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select a persistence type from the Type list. You can retrieve additional types using the <span class="bold">Browse</span> function.</p>
-</li>
-<li>
-<p>Enter the field name and then click <span class="bold">OK</span>. Repeat this procedure for each field.</p>
-</li>
-<li>
-<p>If needed, select <span class="bold">Key</span> to designate the field as a primary key.</p>
-</li>
-<li>
-<p>Select either the <span class="bold">Field-based</span> access type (the default) or <span class="bold">Property-based</span> access type.</p>
-</li>
-</ol>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference002.htm#CIAGGGDF">Create JPA Entity wizard</a><br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
deleted file mode 100644
index d14c825ba4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Using the XML Editor to edit the persistence.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Using the XML Editor to edit the persistence.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHEJAIE" name="CIHEJAIE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Using the XML Editor to edit the persistence.xml file</h1>
-<p><a id="sthref37" name="sthref37"></a><a id="sthref38" name="sthref38"></a>You can work with the <code>persistence.xml</code> by using the XML Editor.</p>
-<p>Use this procedure to work with the <code>persistence.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">Open With &gt; XML Editor</span>.</p>
-<div class="figure"><a id="sthref39" name="sthref39"></a>
-<p class="titleinfigure">Opening the XML Editor</p>
-<img src="img/open_persistence_editor.png" alt="This figure shows the Open &gt; XML Editor option for the persistence.xml file." title="This figure shows the Open &gt; XML Editor option for the persistence.xml file." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p><a id="sthref40" name="sthref40"></a><a id="sthref41" name="sthref41"></a>Use the <span class="gui-object-title">XML Editor</span> to edit the <code>persistence.xml</code> file.</p>
-<div class="figure"><a id="sthref42" name="sthref42"></a>
-<p class="titleinfigure">XML Editor</p>
-<img src="img/persistence_xml_editor.png" alt="This figure shows the XML Editor." title="This figure shows the XML Editor." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHEJAIE">Using the XML Editor to edit the persistence.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
deleted file mode 100644
index cf80ff4c39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Synchronizing classes</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Synchronizing classes" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEBAI" name="CIHFEBAI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Synchronizing classes</h1>
-<p>As you work with the classes in your Java project, you will need to update the <code>persistence.xml</code> file to reflect the changes. <a id="sthref43" name="sthref43"></a><a id="sthref44" name="sthref44"></a></p>
-<p>Use this procedure to synchronize the <code>persistence.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Synchronize Classes</span>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Use this function if you selected <span class="bold">Annotated classes must be listed in the persistence.xml option</span> in the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a>. In general, you do not have to use this function within the container.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref45" name="sthref45"></a>
-<p class="titleinfigure">Synchronizing the persistence.xml File</p>
-<img src="img/synchornize_classes.png" alt="This figure shows the JPA Tools &gt; Synchronize Classes option." title="This figure shows the JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" -->
-<p>Dali adds the necessary <code>&lt;class&gt;</code> elements to the <code>persistence.xml</code> file.</p>
-</li>
-<li>
-<p>Use the <span class="gui-object-title">Persistence XML Editor</span> to continue editing the <code>persistence.xml</code> file.</p>
-</li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks002.htm#CIHEJAIE">Using the XML Editor to edit the persistence.xml file</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
deleted file mode 100644
index 98c8327cc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:43 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Managing the orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref48" name="sthref48"></a>
-<h1>Creating an orm.xml file</h1>
-<p>If you opt not to create an <code>orm.xml</code> file when you create a JPA project, you can create one using the <a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<p>Use this procedure to create an <code>orm.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>From the Navigator or Package Explorer, select <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref49" name="sthref49"></a>
-<p class="titleinfigure">The Select a Wizard Dialog</p>
-<img src="img/select_a_wizard_mapping.png" alt="The Select a Wizard dialog with Mapping file selected." title="The Select a Wizard dialog with Mapping file selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">Mapping File</span> and then click <span class="bold">Next</span>. The Mapping File page appears.</p>
-<div class="figure"><a id="sthref50" name="sthref50"></a>
-<p class="titleinfigure">The Mapping File Page</p>
-<img src="img/mapping_file_new.png" alt="The Mapping File page." title="The Mapping File page." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Define the properties in the page and click <span class="bold">Finish</span>. The <code>orm.xml</code> file appears in the src directory of the selected JPA project. You can manage the orm.xml file using the JPA Details view or through the XML Editor. See also <a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Mapping File Wizard will not allow you to proceed if you select a JPA project that already includes an <code>orm.xml</code> file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
deleted file mode 100644
index ea5d1dd6bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Working with orm.xml file</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Working with orm.xml file" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHBCDCE" name="CIHBCDCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Working with orm.xml file</h1>
-<p><a id="sthref51" name="sthref51"></a><a id="sthref52" name="sthref52"></a>You can work with the <code>orm.xml</code> by using the JPA Details view.</p>
-<p>Use this procedure to work with the <code>orm.xml</code> file:</p>
-<ol start="1">
-<li>
-<p>Right-click the <code>orm.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">Open</span>.</p>
-</li>
-<li>
-<p>In the JPA Structure view, select <span class="bold">EntityMappings</span>.</p>
-</li>
-<li>
-<p>Use the JPA Details view to configure the entity mapping and persistence unit defaults.</p>
-<div class="figure"><a id="sthref53" name="sthref53"></a>
-<p class="titleinfigure">JPA Details view for EntityMappings (orm.xml)</p>
-<img src="img/details_entitymappings.png" alt="JPA Details view for orm.xml file." title="JPA Details view for orm.xml file." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHBCDCE">Working with orm.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
deleted file mode 100644
index 7aef6952a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Entity</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGBIEE" name="BABGBIEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Entity</h1>
-<p><a id="sthref57" name="sthref57"></a><a id="sthref58" name="sthref58"></a><a id="sthref59" name="sthref59"></a><a id="sthref60" name="sthref60"></a>An <span class="bold">Entity</span> is a persistent domain object.</p>
-<p>An entity <span class="italic">can be</span>:</p>
-<ul>
-<li>
-<p>Abstract or concrete classes. Entities may also extend non-entity classes as well as entity classes, and non-entity classes may extend entity classes.</p>
-</li>
-</ul>
-<p>An entity <span class="italic">must have</span>:</p>
-<ul>
-<li>
-<p>A no-arg constructor (public or protected); the entity class may have other constructors as well.</p>
-</li>
-</ul>
-<p><a id="sthref61" name="sthref61"></a><a id="sthref62" name="sthref62"></a><a id="sthref63" name="sthref63"></a>Each persistent entity must be mapped to a database table and contain a primary key. Persistent entities are identified by the <code>@Entity</code> annotation.</p>
-<p>Use this procedure to add persistence to an existing entity:</p>
-<ol start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package Explorer.</span></p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, click the mapping type hyperlink to access the Mapping Type Selection dialog. In the following figure, clicking <span class="italic">entity</span> invokes the dialog from the JPA Details View.</p>
-<div class="figure"><a id="sthref64" name="sthref64"></a>
-<p class="titleinfigure">The Mapping Type Hyperlink</p>
-<img src="img/mapped_entity_type_link.png" alt="The JPA Details view for an entity showing the mapping type hyperlink." title="The JPA Details view for an entity showing the mapping type hyperlink." /><br /></div>
-<!-- class="figure" -->
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also change (or add) persistence for an entity by right-clicking the class in the JPA Structure View and then clicking <span class="bold">Map As &gt; Entity</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-<li>
-<p>Select <span class="bold">Entity</span> from the Mapping Type Selection dialog and then click <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref65" name="sthref65"></a>
-<p class="titleinfigure">The Mapping Type Selection Dialog</p>
-<img src="img/mapping_type_selection_entity.png" alt="The Mapping Type selection dialog with Enity selected." title="The Mapping Type selection dialog with Enity selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
deleted file mode 100644
index efd109a179..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Embeddable</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embeddable" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFEICE" name="BABFEICE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embeddable</h1>
-<p><a id="sthref66" name="sthref66"></a><a id="sthref67" name="sthref67"></a>An <span class="bold">Embedded</span> class is a class whose instances are stored as part of an owning entity; it shares the identity of the owning entity. Each field of the embedded class is mapped to the database table associated with the owning entity.</p>
-<p>To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref68" name="sthref68"></a><a id="sthref69" name="sthref69"></a><a id="sthref70" name="sthref70"></a>An embeddable entity is identified by the <code>@Embeddable</code> annotation.</p>
-<p>Use this procedure to add embeddable persistence to an existing entity:</p>
-<ol start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>Click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
-</li>
-<li>
-<p>Select <span class="bold">Embeddable</span> and then click <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref71" name="sthref71"></a>
-<p class="titleinfigure">Mapping Type Selection Dialog (Embeddable)</p>
-<img src="img/mapping_type_selection_embed.png" alt="The Mapping Type Selection dialog with Embeddable selected." title="The Mapping Type Selection dialog with Embeddable selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<dl>
-<dd><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></dd>
-<dd><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></dd>
-<dd><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></dd>
-</dl>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
deleted file mode 100644
index e03d3d0e13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:44 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Mapped superclass</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapped superclass" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDAGCI" name="BABDAGCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Mapped superclass</h1>
-<p><a id="sthref72" name="sthref72"></a><a id="sthref73" name="sthref73"></a>An entity that extends a <span class="bold">Mapped Superclass</span> class inherits the persistent state and mapping information from a superclass. You should use a mapped superclass to define mapping information that is common to multiple entity classes.</p>
-<p>A mapped superclass <span class="italic">can be</span>:</p>
-<ul>
-<li>
-<p>Abstract or concrete classes</p>
-</li>
-</ul>
-<p>A mapped superclass <span class="italic">cannot be</span>:</p>
-<ul>
-<li>
-<p>Be queried or passed as an argument to Entity-Manager or Query operations</p>
-</li>
-<li>
-<p>Be the target of a persistent relationship</p>
-</li>
-</ul>
-<p>A mapped superclass does not have a defined database table. Instead, its mapping information is derived from its superclass. To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref74" name="sthref74"></a><a id="sthref75" name="sthref75"></a><a id="sthref76" name="sthref76"></a><a id="sthref77" name="sthref77"></a>A mapped superclass is identified by the <code>@MappedSuperclass</code> annotation.</p>
-<p>Use this procedure to add Mapped Superclass persistence to an existing entity:</p>
-<ol start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
-</li>
-<li>
-<p>Select <span class="bold">Mapped Superclass</span> and then <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref78" name="sthref78"></a>
-<p class="titleinfigure">Mapping Type Selection Dialog (Mapped Superclass)</p>
-<img src="img/mapping_type_selection_superclass.png" alt="The Mapping Type Selection dialog with Mapped Superclass selected." title="The Mapping Type Selection dialog with Mapped Superclass selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
deleted file mode 100644
index f88a6d7472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:45 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Creating Named Queries</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating Named Queries" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIGBGG" name="BABIGBGG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating Named Queries</h1>
-<p><a id="sthref94" name="sthref94"></a><a id="sthref95" name="sthref95"></a>Named queries improve application performance because they are prepared once and they (and all of their associated supporting objects) can be efficiently reused thereafter, making them well suited for complex and frequently executed operations. Named queries use the JPA query language for portable execution on any underlying database; named native queries use the SQL language native to the underlying database.</p>
-<p>Use this procedure to add <code>@NamedQuery</code> and <code>@NamedNativeQuery</code> annotations to the entity.</p>
-<p>To create a named query:</p>
-<ol start="1">
-<li>
-<p>Select the entity in the Package Explorer.</p>
-</li>
-<li>
-<p>In the JPA Details view, expand Queries.</p>
-</li>
-<li>
-<p>Click <span class="bold">Add</span> for a named query, or <span class="bold">Add Native</span> for a native query.</p>
-</li>
-<li>
-<p>In the dialog that appears, enter the name of the query in the Name field and then click OK.</p>
-</li>
-<li>
-<p>Enter the query in the Query field.</p>
-<div class="figure"><a id="sthref96" name="sthref96"></a>
-<p class="titleinfigure">Entering a Named Query</p>
-<img src="img/task_entering_query.png" alt="The Queries section of the JPA Details view." title="The Queries section of the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
deleted file mode 100644
index d7c93f70a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Basic mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Basic mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBABCE" name="BABBABCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Basic mapping</h1>
-<p><a id="sthref97" name="sthref97"></a><a id="sthref98" name="sthref98"></a><a id="sthref99" name="sthref99"></a><a id="sthref100" name="sthref100"></a>Use a <span class="bold">Basic Mapping</span> to map an attribute directly to a database column. Basic mappings may be used only with the following attribute types:</p>
-<ul>
-<li>
-<p>Java primitive types and wrappers of the primitive types</p>
-</li>
-<li>
-<p><code>java.lang.String, java.math.BigInteger</code></p>
-</li>
-<li>
-<p><code>java.math.BigDecimal</code></p>
-</li>
-<li>
-<p><code>java.util.Date</code></p>
-</li>
-<li>
-<p><code>java.util.Calendar, java.sql.Date</code></p>
-</li>
-<li>
-<p><code>java.sql.Time</code></p>
-</li>
-<li>
-<p><code>java.sql.Timestamp</code></p>
-</li>
-<li>
-<p><code>byte[]</code></p>
-</li>
-<li>
-<p><code>Byte[]</code></p>
-</li>
-<li>
-<p><code>char[]</code></p>
-</li>
-<li>
-<p><code>Character[]</code></p>
-</li>
-<li>
-<p>enums</p>
-</li>
-<li>
-<p>any other type that implements <code>Serializable</code></p>
-</li>
-</ul>
-<p>To create a basic mapping:</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, right-click the field to map. Select <span class="bold">Map As &gt; Basic</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">Entity Map Hyperlink</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Defines this mapping as a <span class="bold">Basic Mapping</span>.
-<p>This corresponds to the <code>@Basic</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t15 r1c3-t15">Basic</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Column</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t15 r1c3-t15">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15">Table</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">Name of the database table.</td>
-<td align="left" headers="r4c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t15" headers="r1c1-t15">Fetch</td>
-<td align="left" headers="r5c1-t15 r1c2-t15">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t15 r1c3-t15">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15">Optional</td>
-<td align="left" headers="r6c1-t15 r1c2-t15">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t15 r1c3-t15">Yes</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t15" headers="r1c1-t15">Temporal</td>
-<td align="left" headers="r7c1-t15 r1c2-t15">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t15" headers="r1c1-t15">Lob</td>
-<td align="left" headers="r8c1-t15 r1c2-t15">Specifies if this is a large objects (BLOB or CLOB). See <a href="ref_mapping_general.htm#CACBBIBI">"Lob"</a> for details.</td>
-<td align="left" headers="r8c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>",
- insertable=<span class="italic">&lt;INSERTABLE&gt;</span>, updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Basic(fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, optional = <span class="italic">&lt;OPTIONAL&gt;</span>)
-@Temporal(TemporalType.<span class="italic">&lt;TEMPORAL&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
deleted file mode 100644
index d0d838df60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Embedded mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCBHDF" name="BABCBHDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embedded mapping</h1>
-<p><a id="sthref101" name="sthref101"></a><a id="sthref102" name="sthref102"></a><a id="sthref103" name="sthref103"></a><a id="sthref104" name="sthref104"></a>Use an <span class="bold">Embedded Mapping</span> to specify a persistent field or property of an entity whose value is an instance of an embeddable class.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, right-click the field to map.</p>
-</li>
-<li>
-<p>Select <span class="bold">Map as &gt; Embedded</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">Entity Mapping Hyperlnk</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">Defines this mapping as a <span class="bold">Embedded</span>.
-<p>This corresponds to the <code>@Embedded</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">Embedded</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16">Attribute Overrides</td>
-<td align="left" headers="r3c1-t16 r1c2-t16">Specify to override the default mapping of an entity's attribute. Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r3c1-t16 r1c3-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16">Columns</td>
-<td align="left" headers="r4c1-t16 r1c2-t16">The database column (and its table) mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.
-<ul>
-<li>
-<p>Name &ndash; Name of the database column.</p>
-</li>
-<li>
-<p>Table &ndash; Name of the database table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t16 r1c3-t16"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Embedded
-@AttributeOverride(column=@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name = "<span class="italic">&lt;COLUMN_NAME&gt;</span>"))
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
deleted file mode 100644
index 6b35d9c247..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Embedded ID mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded ID mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDIAEE" name="CIHDIAEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embedded ID mapping</h1>
-<p><a id="sthref105" name="sthref105"></a><a id="sthref106" name="sthref106"></a><a id="sthref107" name="sthref107"></a><a id="sthref108" name="sthref108"></a>Use an <span class="bold">Embedded ID Mapping</span> to specify the primary key of an embedded ID. These mappings may be used with a <a href="tasks007.htm#BABFEICE">Embeddable</a> entities.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Embedded Id</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">Defines this mapping as a <span class="bold">Embedded Id</span>.
-<p>This corresponds to the <code>@EmbeddedId</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">Embedded Id</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@EmbeddedId
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
deleted file mode 100644
index b8592d92ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
+++ /dev/null
@@ -1,169 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:46 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>ID mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="ID mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGCBHG" name="BABGCBHG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>ID mapping</h1>
-<p><a id="sthref109" name="sthref109"></a><a id="sthref110" name="sthref110"></a><a id="sthref111" name="sthref111"></a><a id="sthref112" name="sthref112"></a>Use an <span class="bold">ID Mapping</span> to specify the primary key of an entity. ID mappings may be used with a <a href="tasks006.htm#BABGBIEE">Entity</a> or <a href="tasks008.htm#BABDAGCI">Mapped superclass</a>. Each <a href="tasks006.htm#BABGBIEE">Entity</a> must have an ID mapping.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right click the filed and then select <span class="bold">Map as &gt; ID</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-<th align="left" valign="bottom" id="r1c3-t18">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">Defines this mapping as an <span class="bold">ID Mapping</span>.
-<p>This field corresponds to the <code>@Id</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t18 r1c3-t18">ID</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">Column</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t18 r1c3-t18">By default, the Column is assumed to be named identically to the attribute.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t18" headers="r1c1-t18">Table</td>
-<td align="left" headers="r4c1-t18 r1c2-t18">The database table mapped to the entity attribute.</td>
-<td align="left" headers="r4c1-t18 r1c3-t18">By default, the Table is assumed to be identical to the table associated with the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t18" headers="r1c1-t18">Temporal</td>
-<td align="left" headers="r5c1-t18 r1c2-t18">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t18 r1c3-t18"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the PK Generation tab." summary="This table lists the fields in the PK Generation tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t19">Property</th>
-<th align="left" valign="bottom" id="r1c2-t19">Description</th>
-<th align="left" valign="bottom" id="r1c3-t19">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t19" headers="r1c1-t19">Primary Key Generation</td>
-<td align="left" headers="r2c1-t19 r1c2-t19">These fields define how the primary key is generated.</td>
-<td align="left" headers="r2c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t19 r1c2-t19">See <a href="ref_primary_key.htm#CACBAJBC">"Primary Key Generation"</a> for details.
-<ul>
-<li>
-<p>Auto</p>
-</li>
-<li>
-<p>Sequence</p>
-</li>
-<li>
-<p>Identity</p>
-</li>
-<li>
-<p>Table</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t19 r1c3-t19">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Generator&nbsp;Name</td>
-<td align="left" headers="r4c1-t19 r1c2-t19">Name of the primary key generator specified in the <span class="bold">Strategy</span></td>
-<td align="left" headers="r4c1-t19 r1c3-t19"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Additional fields will appear in the <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area, depending on the selected Strategy. See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for additional information.</p>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;TABLE_NAME&gt;</span>", insertable=<span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Temporal(<span class="italic">&lt;TEMPORAL&gt;</span>)
-@GeneratedValue(strategy=GeneratorType.<span class="italic">&lt;STRATEGY&gt;</span>, generator="<span class="italic">&lt;GENERATOR_NAME&gt;</span>")@TableGenerator(name="<span class="italic">&lt;TABLE_GENERATOR_NAME&gt;</span>", table = "<span class="italic">&lt;TABLE_GENERATOR_TABLE&gt;</span>",
- pkColumnName = "<span class="italic">&lt;TABLE_GENERATOR_PK&gt;</span>",
- valueColumnName = "<span class="italic">&lt;TABLE_GENERATOR_VALUE_COLUMN&gt;</span>",
- pkColumnValue = "<span class="italic">&lt;TABLE_GENERATOR_PK_COLUMN_VALUE&gt;</span>")@SequenceGenerator(name="<span class="italic">&lt;SEQUENCE_GENERATOR_NAME&gt;</span>",
- sequenceName="<span class="italic">&lt;SEQUENCE_GENERATOR_SEQUENCE&gt;</span>")
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
deleted file mode 100644
index 91b6ae91c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
+++ /dev/null
@@ -1,172 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Many-to-many mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-many mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEIEGD" name="BABEIEGD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Many-to-many mapping</h1>
-<p><a id="sthref113" name="sthref113"></a><a id="sthref114" name="sthref114"></a><a id="sthref115" name="sthref115"></a><a id="sthref116" name="sthref116"></a>Use a <span class="bold">Many-to-Many Mapping</span> to define a many-valued association with many-to-many multiplicity. A many-to-many mapping has two sides: the <span class="italic">owning side</span> and <span class="italic">non-owning side</span>. You must specify the join table on the owning side. For bidirectional mappings, either side may be the owning side.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Many-toMany</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields of the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t20">Property</th>
-<th align="left" valign="bottom" id="r1c2-t20">Description</th>
-<th align="left" valign="bottom" id="r1c3-t20">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t20" headers="r1c1-t20">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">Defines this mapping as a <span class="bold">Many to Many Mapping</span>.
-<p>This field corresponds to the <code>@ManyToMany</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t20 r1c3-t20">Many to Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">Target Entity</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t20 r1c3-t20">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">Fetch</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t20 r1c3-t20">Lazy</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t20" headers="r1c1-t20">Mapped By</td>
-<td align="left" headers="r5c1-t20 r1c2-t20">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t20" headers="r1c1-t20">Order By</td>
-<td align="left" headers="r6c1-t20 r1c2-t20">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t20 r1c3-t20">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in the <a href="reference014.htm#CACBAEBC">Join Table Information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t21">Property</th>
-<th align="left" valign="bottom" id="r1c2-t21">Description</th>
-<th align="left" valign="bottom" id="r1c3-t21">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t21" headers="r1c1-t21">Name</td>
-<td align="left" headers="r2c1-t21 r1c2-t21">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t21 r1c3-t21">You must specify the join table on the owning side.
-<p>By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t21" headers="r1c1-t21">Join Columns</td>
-<td align="left" headers="r3c1-t21 r1c2-t21">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r3c1-t21 r1c3-t21">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t21" headers="r1c1-t21">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t21 r1c2-t21">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t21 r1c3-t21">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>To add a new Join or Inverse Join Column, click <span class="gui-object-action">Add</span>.</p>
-<p>To edit an existing Join or Inverse Join Column, select the field to and click <span class="gui-object-action">Edit</span>.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToMany(cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>, fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
deleted file mode 100644
index b7943aaab5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Many-to-one mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-one mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHFAFJ" name="BABHFAFJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Many-to-one mapping</h1>
-<p><a id="sthref117" name="sthref117"></a><a id="sthref118" name="sthref118"></a><a id="sthref119" name="sthref119"></a><a id="sthref120" name="sthref120"></a>Use a <span class="bold">Many-to-One</span> mapping to defines a single-valued association to another entity class that has many-to-one multiplicity.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right click the field and then select <span class="bold">Map As &gt; Many-to-One</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields ion the General tab for this mapping." summary="This table lists the fields ion the General tab for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t22">Property</th>
-<th align="left" valign="bottom" id="r1c2-t22">Description</th>
-<th align="left" valign="bottom" id="r1c3-t22">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t22" headers="r1c1-t22">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t22 r1c2-t22">Defines mapping as <span class="bold">Many-to-One</span>. This corresponds to the <code>@ManyToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t22 r1c3-t22">Many-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t22" headers="r1c1-t22">Target Entity</td>
-<td align="left" headers="r3c1-t22 r1c2-t22">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t22 r1c3-t22">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t22" headers="r1c1-t22">Fetch</td>
-<td align="left" headers="r4c1-t22 r1c2-t22">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t22 r1c3-t22">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t22" headers="r1c1-t22">Cascade</td>
-<td align="left" headers="r5c1-t22 r1c2-t22">See <a href="ref_mapping_general.htm#CACJAIHB">"Cascade Type"</a> for details.
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>All</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t22 r1c3-t22">Default</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t22" headers="r1c1-t22">Optional</td>
-<td align="left" headers="r6c1-t22 r1c2-t22">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t22 r1c3-t22">Yes</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields on the <a href="reference015.htm#CACFCEJC">Join Columns Information</a> tab in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t23">Property</th>
-<th align="left" valign="bottom" id="r1c2-t23">Description</th>
-<th align="left" valign="bottom" id="r1c3-t23">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t23" headers="r1c1-t23">Join Column</td>
-<td align="left" headers="r2c1-t23 r1c2-t23"><a id="sthref121" name="sthref121"></a><a id="sthref122" name="sthref122"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t23 r1c3-t23">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, fetch=<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- cascade=<span class="italic">&lt;CASCADE_TYPE&gt;</span>)
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
deleted file mode 100644
index c24117b252..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
+++ /dev/null
@@ -1,190 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>One-to-many mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-many mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHGEBD" name="BABHGEBD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>One-to-many mapping</h1>
-<p><a id="sthref123" name="sthref123"></a><a id="sthref124" name="sthref124"></a><a id="sthref125" name="sthref125"></a><a id="sthref126" name="sthref126"></a>Use a <span class="bold">One-to-Many Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; One-to-many</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the General tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the General tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t24">Property</th>
-<th align="left" valign="bottom" id="r1c2-t24">Description</th>
-<th align="left" valign="bottom" id="r1c3-t24">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t24" headers="r1c1-t24">Mapping Entity Type Hyperlink</td>
-<td align="left" headers="r2c1-t24 r1c2-t24">Defines mapping as <span class="bold">One-to-Many</span>. This corresponds to the <code>@OneToMany</code> annotation.</td>
-<td align="left" headers="r2c1-t24 r1c3-t24">One-to-Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t24" headers="r1c1-t24">Target Entity</td>
-<td align="left" headers="r3c1-t24 r1c2-t24">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t24" headers="r1c1-t24">Cascade</td>
-<td align="left" headers="r4c1-t24 r1c2-t24">See <a href="ref_mapping_general.htm#CACJAIHB">"Cascade Type"</a> for details.
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>All</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t24" headers="r1c1-t24">Fetch</td>
-<td align="left" headers="r5c1-t24 r1c2-t24">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t24 r1c3-t24">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t24" headers="r1c1-t24">Mapped By</td>
-<td align="left" headers="r6c1-t24 r1c2-t24">The database field that owns the relationship.</td>
-<td align="left" headers="r6c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t24" headers="r1c1-t24">Order By</td>
-<td align="left" headers="r7c1-t24 r1c2-t24">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t24 r1c3-t24">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference014.htm#CACBAEBC">Join Table Information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t25">Property</th>
-<th align="left" valign="bottom" id="r1c2-t25">Description</th>
-<th align="left" valign="bottom" id="r1c3-t25">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t25" headers="r1c1-t25">Name</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">Name of the join table</td>
-<td align="left" headers="r2c1-t25 r1c3-t25">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">Join Columns</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">Specify two or more join columns (that is, a primary key).</td>
-<td align="left" headers="r3c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t25 r1c2-t25">The join column on the owned (or inverse) side of the association: the owned entity's primary key column.</td>
-<td align="left" headers="r4c1-t25 r1c3-t25"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>)
-@Column(name="<span class="italic">&lt;COLUMN&gt;</span>")
-
-
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>.class, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-@JoinTable(name="<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>", joinColumns=@JoinColumn(name=
- "<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName="<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"),
- inverseJoinColumns=@JoinColumn(name="<span class="italic">&lt;INVERSE_JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName="<span class="italic">&lt;INVERSE_JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"))
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
deleted file mode 100644
index 7502303b93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:47 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>One-to-one mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-one mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFHBCJ" name="BABFHBCJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>One-to-one mapping</h1>
-<p><a id="sthref127" name="sthref127"></a><a id="sthref128" name="sthref128"></a><a id="sthref129" name="sthref129"></a><a id="sthref130" name="sthref130"></a>Use a <span class="bold">One-to-One Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; One-to-One</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t26">Property</th>
-<th align="left" valign="bottom" id="r1c2-t26">Description</th>
-<th align="left" valign="bottom" id="r1c3-t26">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t26" headers="r1c1-t26">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t26 r1c2-t26">Defines mapping as <span class="bold">One-to-One</span>. This corresponds to the <code>@OneToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t26 r1c3-t26">One-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t26" headers="r1c1-t26">Target Entity</td>
-<td align="left" headers="r3c1-t26 r1c2-t26">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t26 r1c3-t26">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t26" headers="r1c1-t26">Fetch Type</td>
-<td align="left" headers="r4c1-t26 r1c2-t26">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t26 r1c3-t26">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t26" headers="r1c1-t26">Mapped By</td>
-<td align="left" headers="r5c1-t26 r1c2-t26">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t26 r1c3-t26"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference015.htm#CACFCEJC">Join Columns Information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t27">Property</th>
-<th align="left" valign="bottom" id="r1c2-t27">Description</th>
-<th align="left" valign="bottom" id="r1c3-t27">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t27" headers="r1c1-t27">Join Column</td>
-<td align="left" headers="r2c1-t27 r1c2-t27"><a id="sthref131" name="sthref131"></a><a id="sthref132" name="sthref132"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t27 r1c3-t27">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName=
- "<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>", insertable = <span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable = <span class="italic">&lt;UPDATABLE&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
deleted file mode 100644
index 59bbb35eda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Transient mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Transient mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHFHEI" name="BABHFHEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Transient mapping</h1>
-<p><a id="sthref133" name="sthref133"></a><a id="sthref134" name="sthref134"></a><a id="sthref135" name="sthref135"></a><a id="sthref136" name="sthref136"></a>Use the Transient Mapping to specify a field of the entity class that <span class="italic">is not</span> persistent.</p>
-<p>To create a transient mapping:</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As Transient</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotation to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Transient
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
deleted file mode 100644
index 9dde2935bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Version mapping</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Version mapping" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHIBII" name="BABHIBII"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Version mapping</h1>
-<p><a id="sthref137" name="sthref137"></a><a id="sthref138" name="sthref138"></a><a id="sthref139" name="sthref139"></a><a id="sthref140" name="sthref140"></a>Use a <span class="bold">Version Mapping</span> to specify the field used for optimistic locking. If the entity is associated with multiple tables, you should use a version mapping only with the primary table. You should have only a single version mapping per persistent entity. Version mappings may be used only with the following attribute types:</p>
-<ul>
-<li>
-<p><code>int</code></p>
-</li>
-<li>
-<p><code>Integer</code></p>
-</li>
-<li>
-<p><code>short, Short</code></p>
-</li>
-<li>
-<p><code>long, Long</code></p>
-</li>
-<li>
-<p><code>Timestamp</code></p>
-</li>
-</ul>
-<p>To create a version mapping:</p>
-<ol start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Version</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t28">Property</th>
-<th align="left" valign="bottom" id="r1c2-t28">Description</th>
-<th align="left" valign="bottom" id="r1c3-t28">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t28" headers="r1c1-t28">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t28 r1c2-t28">Defines the mapping as Version. This corresponds to the <code>@Version</code> annotation.</td>
-<td align="left" headers="r2c1-t28 r1c3-t28">Version</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t28" headers="r1c1-t28">Column</td>
-<td align="left" headers="r3c1-t28 r1c2-t28">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t28 r1c3-t28">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t28" headers="r1c1-t28">Table</td>
-<td align="left" headers="r4c1-t28 r1c2-t28">Name of the database table. This must be the primary table associated with the attribute's entity.</td>
-<td align="left" headers="r4c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t28" headers="r1c1-t28">Temporal</td>
-<td align="left" headers="r5c1-t28 r1c2-t28">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t28 r1c3-t28"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Version
-@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name="&lt;<span class="italic">COLUMN_NAME</span>&gt;")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
deleted file mode 100644
index 15b7a7dbcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generating entities from tables</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating entities from tables" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBAGFI" name="BABBAGFI"></a></p>
-<div class="sect1">
-<h1>Generating entities from tables</h1>
-<p><a id="sthref141" name="sthref141"></a><a id="sthref142" name="sthref142"></a>Use this procedure to generate Java persistent entities from database tables. You must create a JPA project and establish a database connection <span class="italic">before</span> generating persistent entities. See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.</p>
-<ol start="1">
-<li>
-<p>Right-click the JPA project in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Entities</span>.</p>
-<div class="figure"><a id="sthref143" name="sthref143"></a>
-<p class="titleinfigure">Generating Entities</p>
-<img src="img/generate_entities.png" alt="Using the JPA Tools &gt; Generate Entities menu option." title="Using the JPA Tools &gt; Generate Entities menu option." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>If you are not currently connected to the database, the Database Connection page appears. Select your database connection and schema, and click <span class="bold">Reconnect</span>.</p>
-<p>To create a new database connection, click <span class="bold">Add connection</span>.</p>
-<p>After connecting to the database, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p><a id="sthref144" name="sthref144"></a><a id="sthref145" name="sthref145"></a>On the <a href="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a> dialog, select the tables from which to generate Java persistent entities and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<p>Eclipse creates a Java persistent entity for each database table. Each entity contains fields based on the table's columns. Eclipse will also generate entity relationships (such as one-to-one) based on the table constraints. <a href="#CIHJIJJC">Figure: Generating Entities from Tables</a> illustrates how Eclipse generates entities from tables.</p>
-<div class="figure"><a id="CIHJIJJC" name="CIHJIJJC"></a>
-<p class="titleinfigure">Generating Entities from Tables</p>
-<img src="img/table_entity.png" alt="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." title="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
deleted file mode 100644
index 246f1e40da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generating DDL from Entities</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating DDL from Entities" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHJIGBE" name="CIHJIGBE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating DDL from Entities</h1>
-<p>When using a vendor-specific platform, you can create a DDL script from your persistent entities.</p>
-<p>To generate a DDL script:</p>
-<p>Right-click the JPA project in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate DDL</span>.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="tasks001.htm#BABFBJBG">Creating a JPA Entity</a></p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
deleted file mode 100644
index 892855f71c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:48 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Validating mappings and reporting problems</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Validating mappings and reporting problems" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAIBA" name="BABFAIBA"></a></p>
-<div class="sect1">
-<h1>Validating mappings and reporting problems</h1>
-<p><a id="sthref146" name="sthref146"></a><a id="sthref147" name="sthref147"></a><a id="sthref148" name="sthref148"></a><a id="sthref149" name="sthref149"></a>Errors and warnings on persistent entities and mappings are indicated with a red error or yellow warning next to the resource with the error, as well as the parent containers up to the project.</p>
-<div class="figure"><a id="sthref150" name="sthref150"></a>
-<p class="titleinfigure">Sample Errors and Warnings</p>
-<img src="img/error_sample.png" alt="This figure shows sample error and warning icons in the Explorer view." title="This figure shows sample error and warning icons in the Explorer view." /><br /></div>
-<!-- class="figure" -->
-<p>This section contains information on the following:</p>
-<ul>
-<li>
-<p><a href="tasks023.htm#CIHFEDEI">Error messages</a></p>
-</li>
-<li>
-<p><a href="tasks024.htm#CIHGEAIJ">Warning messages</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm
deleted file mode 100644
index af2541b288..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Error messages</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Error messages" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEDEI" name="CIHFEDEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Error messages<a id="sthref151" name="sthref151"></a></h1>
-<p>This section contains information on error messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref152" name="sthref152"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE__NAME&gt;</span>" has invalid mapping type in this context</p>
-<p>The mapped attribute is invalid. Either change the mapping type or change the entity type.</p>
-<p>See <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a> for more information.</p>
-<a id="sthref153" name="sthref153"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE_NAME&gt;</span>" cannot be resolved.</p>
-<p>Dali cannot map the attribute to a database table and column. Verify that you database connection information is correct.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.</p>
-<a id="sthref154" name="sthref154"></a>
-<p class="subhead2">Class "<span class="italic">&lt;CLASS_NAME&gt;</span>" is not annotated as a persistent class.</p>
-<p>The class has not been identified as a persistent class. Configure the class as an Entity, Mapped Superclass, or Embeddable persistent entity.</p>
-<p>See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref155" name="sthref155"></a>
-<p class="subhead2">Column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>You mapped an entity's field to an incorrect or invalid column in the database table. By default, Dali will attempt to map each field in the entity with an identically named row in the database table. If the field's name differs from the row's name, you must explicitly create the mapping.</p>
-<p>Map the field to a valid row in the database table as shown in <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a>.</p>
-<a id="sthref156" name="sthref156"></a>
-<p class="subhead2">Duplicate class "<span class="italic">&lt;CLASS_NAME&gt;</span>".</p>
-<p>You created to persistence classes with the same name. Each Java class must have a unique name. See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a> for more information.</p>
-<a id="sthref157" name="sthref157"></a>
-<p class="subhead2">Entity does not have an Id or Embedded Id.</p>
-<p>You created a persistent entity without identifying its primary key. A persistent entity must have a primary key field designated with an <code>@Id</code> or <code>@EmbeddedId</code> annotation.</p>
-<p>Add an ID mapping to the entity as shown in <a href="tasks013.htm#BABGCBHG">"ID mapping"</a> or <a href="tasks012.htm#CIHDIAEE">"Embedded ID mapping"</a>.</p>
-<a id="sthref158" name="sthref158"></a>
-<p class="subhead2">Multiple persistence.xml files in project.</p>
-<p>You created a JPA project with more than one <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref159" name="sthref159"></a>
-<p class="subhead2">No persistence unit defined.</p>
-<p>There is no persistence unit defined in the <code>persistence.xml</code> file. Use the &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>" tag to define the persistent unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref160" name="sthref160"></a>
-<p class="subhead2">No persistence.xml file in project.</p>
-<p>You created a JPA project without a <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref161" name="sthref161"></a>
-<p class="subhead2">Referenced column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" in join column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>The column that you selected to join a relationship mapping does not exist on the database table. Either select a different column on the <a href="reference014.htm#CACBAEBC">Join Table Information</a> or create the necessary column on the database table.</p>
-<p>See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for more information.</p>
-<a id="sthref162" name="sthref162"></a>
-<p class="subhead2">Schema "&lt;<span class="italic">SCHEMA_NAME</span>&gt;" cannot be resolved for table/join table "&lt;<span class="italic">TABLE_NAME</span>&gt;".</p>
-<p>Define the default database schema information in the persistence unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref163" name="sthref163"></a>
-<p class="subhead2">Table "<span class="italic">&lt;TABLE_NAME&gt;</span>" cannot be resolved.</p>
-<p>You associated a persistent entity to an incorrect or invalid database table. By default, Dali will attempt to associate each persistent entity with an identically named database table. If the entity's name differs from the table's name, you must explicitly create the association.</p>
-<p>Associate the entity with a valid database table as shown in <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref164" name="sthref164"></a>
-<p class="subhead2">Unresovlved generator "<span class="italic">&lt;GENERATOR_NAME&gt;</span>" is defined in persistence unit.</p>
-<p>You created a persistence entity that uses sequencing or a table generator, but did not define the generator in the persistence unit. Either define the generator by using an annotation or including it in the XML mapping file.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm
deleted file mode 100644
index fbcdec3bde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Warning messages</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Warning messages" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHGEAIJ" name="CIHGEAIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Warning messages</h1>
-<p>This section contains information on warning messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref165" name="sthref165"></a>
-<p class="subhead2">Connection "<span class="italic">&lt;CONNECTION_NAME&gt;</span>" is not active. No validation will be done against the data source.</p>
-<p>The database connection you specified to use with the JPA project is not active. The JPA project requires an active connection.</p>
-<a id="sthref166" name="sthref166"></a>
-<p class="subhead2">No connection specified for the project. No data-specific validation will be performed.</p>
-<p>You created a JPA project without specifying a database connection. The JPA project requires an active connection.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> or <a href="tasks025.htm#BABDBCBI">"Modifying persistent project properties"</a> for information on specifying a database connection.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
deleted file mode 100644
index ae5f8006c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:49 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Modifying persistent project properties</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Modifying persistent project properties" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDBCBI" name="BABDBCBI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Modifying persistent project properties</h1>
-<p>Each persistent project must be associated with a database connection. To create a new database connection, click <span class="gui-object-action">Database Connection</span> use the New Connection wizard.</p>
-<p>Use this procedure to modify the vender-specific platform and database connection associated with your JPA project.</p>
-<ol start="1">
-<li>
-<p>Right-click the project in the <span class="gui-object-title">Explorer</span> view and select <span class="gui-object-action">Properties</span>. The Properties page appears.</p>
-<div class="figure"><a id="sthref167" name="sthref167"></a>
-<p class="titleinfigure">The Properties Page</p>
-<img src="img/project_properties_tasks.png" alt="The Persistence page." title="The Persistence page." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Use this table to complete the remaining fields on the Properties &ndash; JPA page and click <span class="bold">OK</span>.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Properties - Java Persistence dialog." summary="This table lists the fields in the Properties - Java Persistence dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t29">Property</th>
-<th align="left" valign="bottom" id="r1c2-t29">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t29" headers="r1c1-t29">Platform</td>
-<td align="left" headers="r2c1-t29 r1c2-t29">Select the vendor-specific platform for the JPA implementation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t29" headers="r1c1-t29">Database Connection</td>
-<td align="left" headers="r3c1-t29 r1c2-t29">Database connection to use to store the persistent entities. To create a new connection, click <span class="bold">Add Connection</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t29" headers="r1c1-t29">&nbsp;&nbsp;Override default schema from connection</td>
-<td align="left" headers="r4c1-t29 r1c2-t29">Select a schema other than the default one derived from the connection information. Use this option if the default schema cannot be used. For example, use this option in cases where the deployment login differs from the design-time login.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>To create a new connection, click <span class="bold">Add connections</span>.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
deleted file mode 100644
index 4b31111351..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Tips and tricks</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tips and tricks" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHGHBF" name="CHDHGHBF"></a></p>
-<h1>Tips and tricks</h1>
-<p>The following tips and tricks give some helpful ideas for increasing your productivity.</p>
-<ul>
-<li>
-<p><a href="#BABFIIHA"><span class="bold">Database Connections</span></a></p>
-</li>
-<li>
-<p><a href="#BABCHAHF"><span class="bold">Schema-based persistence.xml</span></a></p>
-</li>
-</ul>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the tips and tricks in this category." summary="This table lists the tips and tricks in this category." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Tip</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2"><a id="BABFIIHA" name="BABFIIHA"></a><span class="bold">Database Connections</span></td>
-<td align="left" headers="r2c1-t2 r1c2-t2">When starting a new workbench session, be sure to reconnect to your database (if you are working online). This allows Dali to provide database-related mapping assistance and validation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2"><a id="BABCHAHF" name="BABCHAHF"></a><span class="bold">Schema-based persistence.xml</span></td>
-<td align="left" headers="r3c1-t2 r1c2-t2">If you are behind a firewall, you may need to configure your Eclipse workspace proxy in the <a href="../org.eclipse.platform.doc.user/reference/ref-72.htm">Preferences dialog</a> (<span class="gui-object-action">Preferences &gt; Internet &gt; Proxy Settings</span>) to properly validate a schema-based <code>persistence.xml</code> file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml b/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
deleted file mode 100644
index 7c1a9d960d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- User Guide -->
- <toc label="Dali Java Persistence Tools User Guide"><topic label="Dali Java Persistence Tools User Guide">
- <topic href="getting_started.htm" label="Getting started">
- <topic href="getting_started001.htm#BABEFHCD" label="Requirements and installation" />
- <topic href="getting_started002.htm#BABIGCJA" label="Dali quick start">
- <topic href="getting_started003.htm#BABDFHDA" label="Creating a new JPA project" />
- <topic href="getting_started004.htm#BABFGDDG" label="Creating a Java persistent entity with persistent fields" />
- </topic>
- </topic>
- <topic href="concepts.htm" label=" Concepts">
- <topic href="concept_persistence.htm#BABCAHIC" label="Understanding Java persistence" />
- <topic href="concept_mapping.htm#BABBDJFI" label="Understanding OR mappings" />
- <topic href="concepts001.htm#BABBGFJG" label="Understanding EJB 3.0 Java Persistence API">
- <topic href="concepts002.htm#CHDHAGIH" label="The persistence.xml file" />
- <topic href="concepts003.htm#CHDBIJAC" label="The orm.xml file" />
- </topic>
- </topic>
- <topic href="tasks.htm" label=" Tasks">
- <topic href="task_create_new_project.htm#CIHHEJCJ" label="Creating a new JPA project" />
- <topic href="tasks001.htm#BABFBJBG" label="Creating a JPA Entity" />
- <topic href="task_manage_persistence.htm#CIHDAJID" label="Managing the persistence.xml file">
- <topic href="tasks002.htm#CIHEJAIE" label="Using the XML Editor to edit the persistence.xml file" />
- <topic href="tasks003.htm#CIHFEBAI" label="Synchronizing classes" />
- </topic>
- <topic href="task_manage_orm.htm#CIHDGDCD" label="Managing the orm.xml file">
- <topic href="tasks004.htm#sthref48" label="Creating an orm.xml file" />
- <topic href="tasks005.htm#CIHBCDCE" label="Working with orm.xml file" />
- </topic>
- <topic href="task_add_persistence.htm#BABHICAI" label="Adding persistence to a class">
- <topic href="tasks006.htm#BABGBIEE" label="Entity" />
- <topic href="tasks007.htm#BABFEICE" label="Embeddable" />
- <topic href="tasks008.htm#BABDAGCI" label="Mapped superclass" />
- </topic>
- <topic href="task_additonal_tables.htm#CIHGBIEI" label="Specifying additional tables" />
- <topic href="task_inheritance.htm#CIHCCCJD" label="Specifying entity inheritance" />
- <topic href="tasks009.htm#BABIGBGG" label="Creating Named Queries" />
- <topic href="task_mapping.htm#BABDGBIJ" label="Mapping an entity">
- <topic href="tasks010.htm#BABBABCE" label="Basic mapping" />
- <topic href="tasks011.htm#BABCBHDF" label="Embedded mapping" />
- <topic href="tasks012.htm#CIHDIAEE" label="Embedded ID mapping" />
- <topic href="tasks013.htm#BABGCBHG" label="ID mapping" />
- <topic href="tasks014.htm#BABEIEGD" label="Many-to-many mapping" />
- <topic href="tasks015.htm#BABHFAFJ" label="Many-to-one mapping" />
- <topic href="tasks016.htm#BABHGEBD" label="One-to-many mapping" />
- <topic href="tasks017.htm#BABFHBCJ" label="One-to-one mapping" />
- <topic href="tasks018.htm#BABHFHEI" label="Transient mapping" />
- <topic href="tasks019.htm#BABHIBII" label="Version mapping" />
- </topic>
- <topic href="tasks020.htm#BABBAGFI" label="Generating entities from tables" />
- <topic href="tasks021.htm#CIHJIGBE" label="Generating DDL from Entities" />
- <topic href="tasks022.htm#BABFAIBA" label="Validating mappings and reporting problems">
- <topic href="tasks023.htm#CIHFEDEI" label="Error messages" />
- <topic href="tasks024.htm#CIHGEAIJ" label="Warning messages" />
- </topic>
- <topic href="tasks025.htm#BABDBCBI" label="Modifying persistent project properties" />
- </topic>
- <topic label=" Reference">
- <topic label="Wizards">
- <topic href="ref_new_jpa_project_wizard.htm#CACBJGBG" label="Create New JPA Project wizard">
- <topic href="ref_new_jpa_project.htm#CACBJAGC" label="New JPA Project page" />
- <topic href="ref_jpa_facet.htm#CACIFDIF" label="JPA Facet page" />
- </topic>
- <topic href="reference002.htm#CIAGGGDF" label="Create JPA Entity wizard">
- <topic href="reference003.htm#CIAFEIGF" label="Entity Class page" />
- <topic href="reference004.htm#CIADECIA" label="Entity Properties page" />
- </topic>
- <topic href="reference005.htm#CIAIJCCE" label="Mapping File Wizard">
- <topic href="reference006.htm#sthref173" label="Mapping File" />
- </topic>
- <topic href="reference007.htm#sthref176" label="Generate DDL from Entities Wizard" />
- </topic>
- <topic label="Property pages">
- <topic href="ref_persistence_prop_view.htm#BABFAEBB" label="JPA Details view (for entities)">
- <topic href="reference009.htm#CACCAGGC" label="General information" />
- <topic href="reference010.htm#CACIJBGH" label="Attribute overrides" />
- <topic href="reference011.htm#CACBHIDA" label="Secondary table information" />
- <topic href="reference012.htm#CACFHGHE" label="Inheritance information" />
- <topic href="reference013.htm#sthref189" label="Queries" />
- </topic>
- <topic href="ref_persistence_map_view.htm#BABIFBAF" label="JPA Details view (for attributes)">
- <topic href="ref_mapping_general.htm#CACBHFIJ" label="General information" />
- <topic href="reference014.htm#CACBAEBC" label="Join Table Information" />
- <topic href="reference015.htm#CACFCEJC" label="Join Columns Information" />
- <topic href="ref_primary_key.htm#CACFCCAB" label="Primary Key Generation information" />
- </topic>
- <topic href="ref_details_orm.htm#CACGDGHC" label="JPA Details view (for orm.xml)">
- <topic href="reference016.htm#CACCACGH" label="General information" />
- <topic href="reference017.htm#CACEAGBG" label="Persistence Unit information" />
- </topic>
- <topic href="ref_persistence_outline.htm#BABEGGFE" label="JPA Structure view" />
- <topic href="reference018.htm#CIACCHID" label="persistence.xml Editor">
- <topic href="reference019.htm#CIACIFGJ" label="General" />
- <topic href="reference020.htm#CIAFFJIE" label="Connection" />
- <topic href="reference021.htm#CIAJAFEG" label="Customization" />
- <topic href="reference022.htm#CIABEDCH" label="Caching" />
- <topic href="reference023.htm#CIABGHHI" label="Logging" />
- <topic href="reference024.htm#CIAFJCHE" label="Options" />
- <topic href="reference025.htm#CIACCFCB" label="Schema Generation" />
- <topic href="reference026.htm#CIAHJDFF" label="Properties" />
- <topic href="reference027.htm#CIAHCJAH" label="Source" />
- </topic>
- </topic>
- <topic label="Preferences">
- <topic href="ref_project_properties.htm#BABJHBCI" label="Project Properties page - JPA Options" />
- </topic>
- <topic label="Dialogs">
- <topic href="task_generate_entities.htm#CACDAFJD" label="Generate Entities from Tables dialog" />
- <topic href="reference030.htm#CACCGEHC" label="Edit Join Columns Dialog" />
- </topic>
- <topic href="ref_persistence_perspective.htm#BABIFBDB" label="JPA Development perspective" />
- <topic label="Icons and buttons">
- <topic href="reference032.htm#CACGEACG" label="Icons" />
- <topic href="reference033.htm#CACDJCEI" label="Buttons" />
- </topic>
- <topic href="reference034.htm#CACBBDIB" label="Dali Developer Documentation" />
- </topic>
- <topic href="tips_and_tricks.htm" label="Tips and tricks">
- <topic href="whats_new001.htm#BGGCJHAG" label="Create JPA Entity Wizard" />
- <topic href="whats_new002.htm#BGGIHJCJ" label="Named Query Support" />
- <topic href="whats_new003.htm#BGGGACCD" label="persistence.xml Editor" />
- <topic href="whats_new004.htm#BGGIICEF" label="Override the Default Schema for Connection" />
- <topic href="whats_new005.htm#sthref253" label="New Mapping File Wizard" />
- <topic href="whats_new006.htm#sthref254" label="Convert to Java Project" />
- <topic href="whats_new007.htm#sthref255" label="Column Definition Support" />
- </topic>
- <topic href="legal.htm" label=" Legal">
- <topic href="about.htm#sthref257" label="About this content" />
- </topic>
- </topic>
-</toc>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
deleted file mode 100644
index b07f07eb11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>What's new</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" What's new" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref249" name="sthref249"></a> What's new</p>
-<p>This section contains descriptions of the following new features and significant changes made to the Dali OR Mapping Tool for Release 2.0:</p>
-<ul>
-<li>
-<p><a href="whats_new001.htm#BGGCJHAG">Create JPA Entity Wizard</a></p>
-</li>
-<li>
-<p><a href="whats_new002.htm#BGGIHJCJ">Named Query Support</a></p>
-</li>
-<li>
-<p><a href="whats_new003.htm#BGGGACCD">persistence.xml Editor</a></p>
-</li>
-<li>
-<p><a href="whats_new004.htm#BGGIICEF">Override the Default Schema for Connection</a></p>
-</li>
-<li>
-<p><a href="whats_new005.htm#BGGGDGIE">New Mapping File Wizard</a></p>
-</li>
-<li>
-<p><a href="whats_new006.htm#BGGCGDJG">The Convert to Java Project Option</a></p>
-</li>
-<li>
-<p><a href="whats_new007.htm#BGGFGBHJ">Defining Columns in JPA Details View for Entity Attributes</a></p>
-</li>
-<li style="list-style: none"><a href="whats_new008.htm#CEGIDCCE">Generate DDL from Entities wizard</a></li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
deleted file mode 100644
index a54720615f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create JPA Entity Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create JPA Entity Wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGCJHAG" name="BGGCJHAG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Create JPA Entity Wizard</h1>
-<p>Use the Create JPA Entity wizard to quickly create an entity. This wizard automatically creates a Java class annotated with <code>@Entity</code> and enables users to add persistence fields to the entity.</p>
-<div class="figure"><a id="sthref250" name="sthref250"></a>
-<p class="titleinfigure">The Create New JPA Entity Wizard</p>
-<img src="img/create_jpa_entity_new.png" alt="The Entity Class page of the Create New JPA Entity wizard." title="The Entity Class page of the Create New JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a><br />
-<a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
deleted file mode 100644
index fc1912cf8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:53 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Named Query Support</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Named Query Support" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGIHJCJ" name="BGGIHJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Named Query Support</h1>
-<p>The JPA Details view for an entity includes functions for adding named and named native queries to an entity.</p>
-<div class="figure"><a id="sthref251" name="sthref251"></a>
-<p class="titleinfigure">Entering a Named Query</p>
-<img src="img/entering_query_new.png" alt="The Queries section of the JPA Details view." title="The Queries section of the JPA Details view." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks009.htm#BABIGBGG">Creating Named Queries</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
deleted file mode 100644
index bcd134cc07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>persistence.xml Editor</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="persistence.xml Editor" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGGACCD" name="BGGGACCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>persistence.xml Editor</h1>
-<p>Rather than edit the XML for <code>persistence.xml</code>, this release of Dali provides an editor that automatically populates the file's <code>&lt;persistence-unit&gt;</code> element, its <code>transaction type</code> attribute as well as its <code>&lt;provider&gt;</code>, <code>&lt;class&gt;</code>, data source and <code>&lt;properties&gt;</code> sub-elements. The edtior also enables you to edit the file directly.</p>
-<div class="figure"><a id="sthref252" name="sthref252"></a>
-<p class="titleinfigure">The persistence.xml Editor</p>
-<img src="img/persistence_editor_new.png" alt="The General page of the persistence.xml Editor." title="The General page of the persistence.xml Editor." /><br /></div>
-<!-- class="figure" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference018.htm#CIACCHID">persistence.xml Editor</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm
deleted file mode 100644
index 7d8acf3534..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Override the Default Schema for Connection</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Override the Default Schema for Connection" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="BGGIICEF" name="BGGIICEF"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Override the Default Schema for Connection</h1>
-<p>In some cases, Dali cannot calculate the correct schema for a project. If such an instance arises, you can override the default schema derived from the connection information using the <span class="bold">Override the Default Schema for Connection</span> option in the JPA Facet page of the Create New JPA Entity wizard (illustrated in <a href="#BGGJFFCD">Figure: Changing the Schema for a Project</a>) or through the properties for the JPA project (accessed by selecting the JPA project and then <span class="bold">Properties &gt; JPA</span>). Use this option when the default login information cannot be used, such as when the deployment login differs from the design-time login.</p>
-<div class="figure"><a id="BGGJFFCD" name="BGGJFFCD"></a>
-<p class="titleinfigure">Changing the Schema for a Project</p>
-<img src="img/change_connection_profile.png" alt="The JPA Facet page of the Create New JPA Project wizard with the Override defualt schema selected." title="The JPA Facet page of the Create New JPA Project wizard with the Override defualt schema selected." /><br /></div>
-<!-- class="figure" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm
deleted file mode 100644
index ccd08ee090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Changing the Schema for a Project</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Changing the Schema for a Project" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref253" name="sthref253"></a>
-<h1>New Mapping File Wizard</h1>
-<p>The Mapping File wizard enables you to add an object map (orm.xml) to a JPA project if no object map exists at the location specified. Completing the wizard results in a stub <code>orm.xml</code> file.</p>
-<div class="figure"><a id="BGGGDGIE" name="BGGGDGIE"></a>
-<p class="titleinfigure">New Mapping File Wizard</p>
-<img src="img/mapping_file_new.png" alt="The Mapping File page of the New Mapping File wizard." title="The Mapping File page of the New Mapping File wizard." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference005.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm
deleted file mode 100644
index e06dfdf434..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>New Mapping File Wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New Mapping File Wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref254" name="sthref254"></a>
-<h1>Convert to Java Project</h1>
-<p>The Convert to JPA Project option (accessed by selecting a Java project and then clicking <span class="bold">New &gt; JPA Tools &gt; Convert to JPA Project</span>) enables you to convert a non-faceted Java project into a faceted Java project. Selecting this option invokes the Modify Faceted Project wizard, which prompts you to add the JPA facet.</p>
-<div class="figure"><a id="BGGCGDJG" name="BGGCGDJG"></a>
-<p class="titleinfigure">The Convert to Java Project Option</p>
-<img src="img/convert_java_project_new.png" alt="A Java project in the Navigator with the JPA Tools &gt; Convert to Java option selected." title="A Java project in the Navigator with the JPA Tools &gt; Convert to Java option selected." /><br /></div>
-<!-- class="figure" --></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm
deleted file mode 100644
index 3ffd422541..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new007.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>The Convert to Java Project Option</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The Convert to Java Project Option" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref255" name="sthref255"></a>
-<h1>Column Definition Support</h1>
-<p>The JPA Details view for attributes enables you to modify the nullable and unique column constraints and such column properties as length, scale, and precision.</p>
-<div class="figure"><a id="BGGFGBHJ" name="BGGFGBHJ"></a>
-<p class="titleinfigure">Defining Columns in JPA Details View for Entity Attributes</p>
-<img src="img/column_support_new.png" alt="The JPA Details View for an entity with its Details section expanded to show the column configuration parameters." title="The JPA Details View for an entity with its Details section expanded to show the column configuration parameters." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm
deleted file mode 100644
index 098e2ea801..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new008.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = July 23, 2008 8:59:54 -->
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Generate DDL from Entities wizard</title>
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate DDL from Entities wizard" />
-<meta name="relnum" content="Release 2.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- start-->
-<!-- contents -->
-</head>
-<body>
-<p><a id="CEGIDCCE" name="CEGIDCCE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generate DDL from Entities wizard</h1>
-<p>Use the <span class="gui-object-title">Generate DDL</span> wizard to quickly create DDL scripts from your persistent entities. Dali automatically creates the necessary primary and foreign keys, based on the entity mappings.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks021.htm#CIHJIGBE">Generating DDL from Entities</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2008,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath
deleted file mode 100644
index 9600ce84df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib" path="lib/persistence.jar" sourcepath="org.eclipse.jpt.eclipselink.core.ddlgensrc.zip"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
deleted file mode 100644
index 376311f646..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core.ddlgen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8041bc2076..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Wed Apr 30 17:24:41 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
deleted file mode 100644
index 3acfcc5af6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.eclipselink.core.ddlgen;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: lib/persistence.jar
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jpt.eclipselink.core;bundle-version="[1.0.0,2.0.0)"
-Export-Package: javax.persistence,
- javax.persistence.spi,
- org.eclipse.jpt.eclipselink.core.ddlgen
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties
deleted file mode 100644
index 0f7bce31e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- lib/persistence.jar,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jar b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jar
deleted file mode 100644
index 1a1b232921..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jar
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties
deleted file mode 100644
index 0e31122359..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence API Tools - EclipseLink Support - DDL Generation
-providerName = Eclipse.org
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
deleted file mode 100644
index 3cea0aebd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.ddlgen;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.jpt.eclipselink.core.internal.context.schema.generation.SchemaGeneration;
-
-/**
- * This class creates a EclipseLink <code>EntityManagerFactory</code>,
- * and executes the DDL generator with the command set in the properties:
- * <code>eclipselink.ddl-generation.output-mode</code>
- * <code>eclipselink.application-location</code>
- *
- * Current command-line arguments:
- * [-pu puName] - persistence unit name
- * [-p propertiesFilePath] - properties for EclipseLink EntityManager
- *
- * Example of a properties file:
- * eclipselink.jdbc.bind-parameters=false
- * eclipselink.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
- * eclipselink.jdbc.url=jdbc\:derby\:c\:/derbydb/testdb;create\=true
- * eclipselink.jdbc.user=tran
- * eclipselink.jdbc.password=
- * eclipselink.logging.level=FINEST
- * eclipselink.logging.timestamp=false
- * eclipselink.logging.thread=false
- * eclipselink.logging.session=false
- * eclipselink.logging.exceptions=true
- * eclipselink.orm.throw.exceptions=true
- * eclipselink.ddl-generation.output-mode=database
- * eclipselink.ddl-generation=drop-and-create-tables
- * eclipselink.application-location=c\:/_Projects_/ExampleDDL
- */
-public class Main
-{
- protected EntityManagerFactory emf;
- private Map<String, String> eclipseLinkProperties;
- private String createDDLFileName;
- private String dropDDLFileName;
- private String appLocation;
- private String eclipseLinkPropertiesPath;
- private boolean isDebugMode;
-
- // ********** constructors **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
- this.initializeWith(args);
-
- this.emf = Persistence.createEntityManagerFactory(this.getPUName(args), this.eclipseLinkProperties);
- this.perform();
- this.closeEntityManagerFactory();
-
- this.dispose();
- return;
- }
-
- protected void perform() {
- // create an EM to generate schema.
- this.emf.createEntityManager().close();
- }
-
- protected void closeEntityManagerFactory() {
- this.emf.close();
- }
-
- private void initializeWith(String[] args) {
-
- this.eclipseLinkPropertiesPath = this.getEclipseLinkPropertiesPath(args);
- this.eclipseLinkProperties = this.getProperties(this.eclipseLinkPropertiesPath);
-
- this.createDDLFileName = this.getConfigPropertyAsString(
- SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME,
- this.eclipseLinkProperties,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME);
-
- this.dropDDLFileName = this.getConfigPropertyAsString(
- SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME,
- this.eclipseLinkProperties,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME);
-
- this.appLocation = this.eclipseLinkProperties.get(
- SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void dispose() {
-
- if( ! this.isDebugMode) {
- new File(this.appLocation + "/" + this.createDDLFileName).delete();
- new File(this.appLocation + "/" + this.dropDDLFileName).delete();
- new File(this.eclipseLinkPropertiesPath).delete();
- }
- }
-
- private Map<String, String> getProperties(String eclipseLinkPropertiesPath) {
-
- Set<Entry<Object, Object>> propertiesSet = null;
- try {
- propertiesSet = this.loadEclipseLinkProperties(eclipseLinkPropertiesPath);
- }
- catch (IOException e) {
- throw new RuntimeException("Missing: " + eclipseLinkPropertiesPath, e);
- }
-
- Map<String, String> properties = new HashMap<String, String>();
- for(Entry<Object, Object> property : propertiesSet) {
- properties.put((String)property.getKey(), (String)property.getValue());
- }
- return properties;
- }
-
- private Set<Entry<Object, Object>> loadEclipseLinkProperties(String eclipseLinkPropertiesPath) throws IOException {
-
- FileInputStream stream = new FileInputStream(eclipseLinkPropertiesPath);
-
- Properties properties = new Properties();
- properties.load(stream);
-
- return properties.entrySet();
- }
-
- // ********** argument queries **********
-
- private String getPUName(String[] args) {
-
- return this.getArgumentValue("-pu", args);
- }
-
- private String getEclipseLinkPropertiesPath(String[] args) {
-
- return this.getArgumentValue("-p", args);
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args);
- }
-
- private String getArgumentValue(String argument, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argument)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private boolean argumentExists(String argument, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argument)) {
- return true;
- }
- }
- return false;
- }
-
- // ****** utility methods *******
-
- /**
- * Check the provided map for an object with the given key. If that object is not available, check the
- * System properties. If it is not available from either location, return the default value.
- * @param propertyKey
- * @param map
- * @param defaultValue
- * @return
- */
- protected String getConfigPropertyAsString(String propertyKey, Map<String, String> overrides, String defaultValue){
- String value = this.getConfigPropertyAsString(propertyKey, overrides);
- if (value == null){
- value = defaultValue;
- }
- return value;
- }
-
- protected String getConfigPropertyAsString(String propertyKey, Map<String, String> overrides){
- String value = null;
- if (overrides != null){
- value = (String)overrides.get(propertyKey);
- }
- if (value == null){
- value = System.getProperty(propertyKey);
- }
- return value;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.classpath b/jpa/plugins/org.eclipse.jpt.gen/.classpath
deleted file mode 100644
index 8f257414e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore b/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.project b/jpa/plugins/org.eclipse.jpt.gen/.project
deleted file mode 100644
index ef2d5088ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 1f15ff2b4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:07 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3e1d50ad46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:28:54 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index 65356ab7c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.gen
-Bundle-Version: 1.2.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.gen.internal; x-friends:="org.eclipse.jpt.ui"
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.gen/about.html b/jpa/plugins/org.eclipse.jpt.gen/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/build.properties b/jpa/plugins/org.eclipse.jpt.gen/build.properties
deleted file mode 100644
index a1fd5b8411..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.gen/component.xml b/jpa/plugins/org.eclipse.jpt.gen/component.xml
deleted file mode 100644
index 7a4e04e21f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.gen"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.gen" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties b/jpa/plugins/org.eclipse.jpt.gen/plugin.properties
deleted file mode 100644
index 4875a8b174..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence API Tools - Entity Gen
-providerName = Eclipse.org
diff --git a/jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties b/jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties
deleted file mode 100644
index 03e8908d0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Copyright (c) 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-PackageGenerator_taskName=Generate Entities
-GenScope_taskName=Build Database Model
-EntityGenerator_taskName=Generate Entity: {0}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java
deleted file mode 100644
index 6b6f88ceae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenTools.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Utility methods for entity generation.
- */
-public class EntityGenTools {
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * class name.
- * @see #convertToUniqueJavaStyleIdentifier(String, boolean, Collection)
- */
- public static String convertToUniqueJavaStyleClassName(String identifier, Collection<String> classNames) {
- return convertToUniqueJavaStyleIdentifier(identifier, true, classNames);
- }
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * attribute (field/property) name.
- * @see #convertToUniqueJavaStyleIdentifier(String, boolean, Collection)
- */
- public static String convertToUniqueJavaStyleAttributeName(String identifier, Collection<String> attributeNames) {
- return convertToUniqueJavaStyleIdentifier(identifier, false, attributeNames);
- }
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * identifier:
- * - if the identifier is all-caps, convert underscores to "camel case"
- * - if the identifier is not all-caps, leave it unchanged (except, possibly, for the first letter)
- * - convert to a legal Java identifier
- * - eliminate illegal characters
- * - if the result is a reserved word, modify it slightly
- * If the result is already one of the specified existing identifiers
- * (ignoring case so we don't have filename collisions on Windows),
- * modify it slightly again.
- * "FOO" => "Foo" or "foo"
- * "FOO_BAR" => "FooBar" or "fooBar"
- * "PACKAGE" => "Package" or "package_"
- */
- public static String convertToUniqueJavaStyleIdentifier(String identifier, boolean capitalizeFirstLetter, Collection<String> identifiers) {
- String result = identifier;
- if (StringTools.stringIsUppercase(result)) {
- // leave mixed case identifiers alone?
- result = StringTools.convertUnderscoresToCamelCase(result, capitalizeFirstLetter);
- } else {
- result = capitalizeFirstLetter ? StringTools.capitalize(result) : StringTools.uncapitalize(result);
- }
- result = NameTools.convertToJavaIdentifier(result);
- // assume that converting to a unique name will not result in a Java reserved word
- // (since no Java reserved words end with a number)
- result = NameTools.uniqueNameForIgnoreCase(result, identifiers);
- return result;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private EntityGenTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
deleted file mode 100644
index c63fdf764b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
+++ /dev/null
@@ -1,1780 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.lang.reflect.Modifier;
-import java.text.Collator;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaModelStatusConstants;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.internal.BooleanHolder;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.osgi.util.NLS;
-
-// TODO format generated code per preferences
-// TODO organize generated imports per preferences
-/**
- * This generator will generate an entity for a table.
- */
-public class EntityGenerator {
- final Config config;
- private final IPackageFragment packageFragment;
- private final GenTable genTable;
- private final String entityClassName;
- private final String pkClassName;
-
-
- // ********** public API **********
-
- static void generateEntity(
- Config config,
- IPackageFragment packageFragment,
- GenTable genTable,
- IProgressMonitor progressMonitor
- ) {
- if ((config == null) || (packageFragment == null) || (genTable == null)) {
- throw new NullPointerException();
- }
- new EntityGenerator(config, packageFragment, genTable).generateEntity(progressMonitor);
- }
-
-
- // ********** constructor/initialization **********
-
- private EntityGenerator(Config config, IPackageFragment packageFragment, GenTable genTable) {
- super();
- this.config = config;
- this.packageFragment = packageFragment;
- this.genTable = genTable;
- this.entityClassName = this.fullyQualify(this.getEntityName());
- this.pkClassName = this.entityClassName + '.' + config.getPrimaryKeyMemberClassName();
- }
-
-
- // ********** code gen **********
-
- private void generateEntity(IProgressMonitor progressMonitor) {
- try {
- this.generateEntity_(progressMonitor);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private void generateEntity_(IProgressMonitor progressMonitor) throws JavaModelException {
- SubMonitor sm = SubMonitor.convert(progressMonitor, this.buildTaskName(), 100);
- String fileName = this.getEntityName() + ".java"; //$NON-NLS-1$
- String source = this.buildSource();
- sm.worked(20);
- try {
- this.packageFragment.createCompilationUnit(fileName, source, false, sm.newChild(40));
- } catch (JavaModelException ex) {
- if (ex.getJavaModelStatus().getCode() == IJavaModelStatusConstants.NAME_COLLISION) {
- if (this.config.getOverwriteConfirmer().overwrite(this.entityClassName)) {
- this.packageFragment.createCompilationUnit(fileName, source, true, sm.newChild(40));
- }
- } else {
- throw ex;
- }
- }
- sm.setWorkRemaining(0);
- }
-
- private String buildTaskName() {
- return NLS.bind(JptGenMessages.EntityGenerator_taskName, this.getEntityName());
- }
-
- /**
- * build the "body" source first; then build the "package" and "imports" source
- * and concatenate the "body" source to it
- */
- private String buildSource() {
- // build the body source first so we can gather up the import statements
- BodySource bodySource = this.buildBodySource();
-
- StringWriter sw = new StringWriter(bodySource.length() + 2000);
- PrintWriter pw = new PrintWriter(sw);
- this.printPackageAndImportsOn(pw, bodySource);
- pw.print(bodySource.getSource());
- return sw.toString();
- }
-
- private BodySource buildBodySource() {
- EntitySourceWriter pw = new EntitySourceWriter(this.getPackageName(), this.entityClassName);
- this.printBodySourceOn(pw);
- return pw;
- }
-
- private void printBodySourceOn(EntitySourceWriter pw) {
- this.printClassDeclarationOn(pw);
-
- pw.indent();
- this.printEntityPrimaryKeyFieldsOn(pw);
- this.printEntityNonPrimaryKeyBasicFieldsOn(pw);
- this.printEntityManyToOneFieldsOn(pw);
- this.printEntityOneToManyFieldsOn(pw);
- this.printEntityOwnedManyToManyFieldsOn(pw);
- this.printEntityNonOwnedManyToManyFieldsOn(pw);
- this.printSerialVersionUIDFieldOn(pw);
- pw.println();
-
- this.printZeroArgumentConstructorOn(this.getEntityName(), this.config.getMethodVisibilityClause(), pw);
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- this.printEntityPrimaryKeyPropertiesOn(pw);
- this.printEntityNonPrimaryKeyBasicPropertiesOn(pw);
- this.printEntityManyToOnePropertiesOn(pw);
- this.printEntityOneToManyPropertiesOn(pw);
- this.printEntityOwnedManyToManyPropertiesOn(pw);
- this.printEntityNonOwnedManyToManyPropertiesOn(pw);
- }
-
- if (this.primaryKeyClassIsRequired()) {
- this.printPrimaryKeyClassOn(pw);
- }
- pw.undent();
-
- pw.print('}');
- pw.println(); // EOF
- }
-
-
- // ********** class declaration **********
-
- private void printClassDeclarationOn(EntitySourceWriter pw) {
- this.printEntityAnnotationOn(pw);
- this.printTableAnnotationOn(pw);
- this.printIdClassAnnotationOn(pw);
-
- pw.print("public class "); //$NON-NLS-1$
- pw.printTypeDeclaration(this.entityClassName);
- if (config.serializable()) {
- pw.print(" implements "); //$NON-NLS-1$
- pw.printTypeDeclaration(Serializable.class.getName());
- }
- pw.print(" {"); //$NON-NLS-1$
- pw.println();
- }
-
- private void printEntityAnnotationOn(EntitySourceWriter pw) {
- pw.printAnnotation(JPA.ENTITY);
- pw.println();
- }
-
- private void printTableAnnotationOn(EntitySourceWriter pw) {
- String tableName = this.config.getDatabaseAnnotationNameBuilder().buildTableAnnotationName(this.getEntityName(), this.getTable());
- if (tableName == null) {
- return; // the default table name is OK
- }
- pw.printAnnotation(JPA.TABLE);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(tableName);
- pw.print(')');
- pw.println();
- }
-
- private void printIdClassAnnotationOn(EntitySourceWriter pw) {
- if (this.primaryKeyClassIsRequired() && this.config.generateIdClassForCompoundPK()) {
- pw.printAnnotation(JPA.ID_CLASS);
- pw.print('(');
- pw.printTypeDeclaration(this.pkClassName);
- pw.print(".class)"); //$NON-NLS-1$
- pw.println();
- }
- }
-
-
- // ********** primary key fields **********
-
- private void printEntityPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- if (this.primaryKeyClassIsRequired() && this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEntityEmbeddedIdPrimaryKeyFieldOn(pw);
- } else {
- this.printEntityReadOnlyPrimaryKeyFieldsOn(pw);
- this.printEntityWritablePrimaryKeyFieldsOn(pw);
- }
- }
-
- private void printEntityEmbeddedIdPrimaryKeyFieldOn(EntitySourceWriter pw) {
- if (this.config.fieldAccessType()) {
- pw.printAnnotation(JPA.EMBEDDED_ID);
- pw.println();
- }
- this.printFieldOn(this.genTable.getAttributeNameForEmbeddedId(), this.pkClassName, pw);
- }
-
- private void printEntityReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, true, true); // true=read-only; true=print ID annotation on fields
- }
-
- private void printEntityWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, false, true); // false=writable; true=print ID annotation on fields
- }
-
- private void printPrimaryKeyFieldsOn(EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.primaryKeyColumns(readOnly); stream.hasNext(); ) {
- this.printPrimaryKeyFieldOn(stream.next(), pw, readOnly, printIdAnnotation);
- }
- }
-
- private Iterator<Column> primaryKeyColumns(boolean readOnly) {
- return readOnly ? this.genTable.readOnlyPrimaryKeyColumns() : this.genTable.writablePrimaryKeyColumns();
- }
-
- // TODO if the field's type is java.util/sql.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the field must be an integral type
- private void printPrimaryKeyFieldOn(Column column, EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- if (this.config.fieldAccessType()) {
- if (printIdAnnotation) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- }
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(fieldName, column);
- if (readOnly) {
- this.printReadOnlyColumnAnnotationOn(columnName, pw);
- } else {
- this.printColumnAnnotationOn(columnName, pw);
- }
- }
- this.printFieldOn(fieldName, column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
- private void printReadOnlyColumnAnnotationOn(String columnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.COLUMN);
- pw.print('(');
- if (columnName != null) {
- pw.print("name="); //$NON-NLS-1$
- pw.printStringLiteral(columnName);
- pw.print(", "); //$NON-NLS-1$
- }
- pw.print("insertable=false, updatable=false)"); //$NON-NLS-1$
- pw.println();
- }
-
-
- // ********** basic fields **********
-
- private void printEntityNonPrimaryKeyBasicFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) {
- this.printEntityNonPrimaryKeyBasicFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonPrimaryKeyBasicFieldOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- if (this.config.fieldAccessType()) {
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(fieldName, column);
- this.printColumnAnnotationOn(columnName, pw);
- }
- if (column.dataTypeIsLOB()) {
- pw.printAnnotation(JPA.LOB);
- pw.println();
- }
- this.printFieldOn(fieldName, column.getJavaTypeDeclaration(), pw);
- }
-
- private void printColumnAnnotationOn(String columnName, EntitySourceWriter pw) {
- if (columnName != null) { // the column name is null if the default is OK
- pw.printAnnotation(JPA.COLUMN);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(columnName);
- pw.print(')');
- pw.println();
- }
- }
-
-
- // ********** many-to-one fields **********
-
- private void printEntityManyToOneFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToOneRelation> stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) {
- this.printEntityManyToOneFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityManyToOneFieldOn(ManyToOneRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printManyToOneAnnotationOn(fieldName, relation, pw);
- }
- this.printFieldOn(fieldName, this.fullyQualify(relation.getReferencedEntityName()), pw);
- }
-
- private void printManyToOneAnnotationOn(String attributeName, ManyToOneRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_ONE);
- pw.println();
- ForeignKey foreignKey = relation.getForeignKey();
- if (foreignKey.referencesSingleColumnPrimaryKey()) {
- // if the FK references a single-column PK, 'referencedColumnName' is not required
- String joinColumnName = this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(attributeName, foreignKey);
- if (joinColumnName == null) {
- // no JoinColumn annotation needed: the default 'name' and 'referencedColumnName' work
- } else {
- // there is only a single join column here (just not the default name)
- this.printJoinColumnAnnotationOn(joinColumnName, null, pw);
- pw.println();
- }
- } else {
- this.printManyToOneJoinColumnsAnnotationOn(foreignKey, pw);
- }
- }
-
- private void printManyToOneJoinColumnsAnnotationOn(ForeignKey foreignKey, EntitySourceWriter pw) {
- if (foreignKey.columnPairsSize() > 1) {
- pw.printAnnotation(JPA.JOIN_COLUMNS);
- pw.print("({"); //$NON-NLS-1$
- pw.println();
- pw.indent();
- }
- this.printJoinColumnAnnotationsOn(foreignKey, pw);
- if (foreignKey.columnPairsSize() > 1) {
- pw.undent();
- pw.println();
- pw.print("})"); //$NON-NLS-1$
- }
- pw.println();
- }
-
- private void printJoinColumnAnnotationsOn(ForeignKey foreignKey, EntitySourceWriter pw) {
- for (Iterator<ForeignKey.ColumnPair> stream = foreignKey.columnPairs(); stream.hasNext(); ) {
- this.printJoinColumnAnnotationOn(stream.next(), pw);
- if (stream.hasNext()) {
- pw.println(',');
- }
- }
- }
-
- private void printJoinColumnAnnotationOn(ForeignKey.ColumnPair columnPair, EntitySourceWriter pw) {
- this.printJoinColumnAnnotationOn(
- this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(columnPair.getBaseColumn()),
- this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(columnPair.getReferencedColumn()),
- pw
- );
- }
-
- /**
- * 'baseColumnName' cannot be null;
- * 'referencedColumnName' is null when the default is applicable (i.e. the
- * referenced column is the single-column primary key column of the
- * referenced table)
- */
- private void printJoinColumnAnnotationOn(String baseColumnName, String referencedColumnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.JOIN_COLUMN);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(baseColumnName);
-
- if (referencedColumnName != null) {
- pw.print(", referencedColumnName="); //$NON-NLS-1$
- pw.printStringLiteral(referencedColumnName);
- }
-
- pw.print(')');
- }
-
-
- // ********** one-to-many fields **********
-
- private void printEntityOneToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<OneToManyRelation> stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) {
- this.printEntityOneToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityOneToManyFieldOn(OneToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printOneToManyAnnotationOn(relation, pw);
- }
- this.printCollectionFieldOn(fieldName, this.fullyQualify(relation.getReferencedEntityName()), pw);
- }
-
- private void printOneToManyAnnotationOn(OneToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.ONE_TO_MANY);
- pw.print("(mappedBy=\""); //$NON-NLS-1$
- pw.print(relation.getMappedBy());
- pw.print("\")"); //$NON-NLS-1$
- pw.println();
- }
-
-
- // ********** owned many-to-many fields **********
-
- private void printEntityOwnedManyToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityOwnedManyToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printOwnedManyToManyAnnotationOn(fieldName, relation, pw);
- }
- this.printCollectionFieldOn(fieldName, this.fullyQualify(relation.getNonOwningEntityName()), pw);
- }
-
- /**
- * only print the JoinTable annotation if one or more of the
- * [generated] elements is not defaulted:
- * name
- * joinColumns
- * inverseJoinColumns
- * thus the need for the 'printJoinTableAnnotation' flag
- */
- private void printOwnedManyToManyAnnotationOn(String attributeName, ManyToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_MANY);
- pw.println();
- BooleanHolder printJoinTableAnnotation = new BooleanHolder(true);
-
- if ( ! relation.joinTableNameIsDefault()) { // db-only test - no need to delegate to platform?
- printJoinTableAnnotation.setFalse();
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print("(name="); //$NON-NLS-1$
- pw.printStringLiteral(this.config.getDatabaseAnnotationNameBuilder().buildJoinTableAnnotationName(relation.getJoinGenTable().getTable()));
- }
-
- this.printJoinTableJoinColumnAnnotationsOn(
- "joinColumns", //$NON-NLS-1$
- attributeName,
- relation.getOwningForeignKey(),
- printJoinTableAnnotation,
- pw
- );
-
- this.printJoinTableJoinColumnAnnotationsOn(
- "inverseJoinColumns", //$NON-NLS-1$
- relation.getNonOwningGenTable().getAttributeNameFor(relation),
- relation.getNonOwningForeignKey(),
- printJoinTableAnnotation,
- pw
- );
-
- if (printJoinTableAnnotation.isFalse()) {
- pw.print(')');
- pw.println();
- }
- }
-
- /**
- * 'elementName' is either "joinColumns" or "inverseJoinColumns"
- */
- private void printJoinTableJoinColumnAnnotationsOn(String elementName, String attributeName, ForeignKey foreignKey, BooleanHolder printJoinTableAnnotation, EntitySourceWriter pw) {
- // we have to pre-calculate whether either 'name' and/or 'referencedColumnName'
- // is required because they are wrapped by the JoinTable annotation and we
- // need to print the JoinTable annotation first (if it hasn't already been printed)
- boolean printRef = ! foreignKey.referencesSingleColumnPrimaryKey();
- // if 'referencedColumnName' is required, 'name' is also required (i.e. it cannot be defaulted);
- // but we will calculate it later [1], since there could be multiple join columns
- String joinColumnName = (printRef) ?
- null // 'joinColumnName' is not used
- :
- this.config.getDatabaseAnnotationNameBuilder().buildJoinColumnAnnotationName(attributeName, foreignKey);
- boolean printBase = (printRef || (joinColumnName != null));
- if (printBase || printRef) {
- if (printJoinTableAnnotation.isTrue()) {
- printJoinTableAnnotation.setFalse();
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print('(');
- } else {
- pw.print(',');
- }
- pw.println();
- pw.indent();
- if (printRef) {
- // if 'printRef' is true, 'joinColumnName' will always be "IGNORED" (so we ignore it)
- this.printJoinTableJoinColumnAnnotationsOn(elementName, foreignKey, pw); // [1]
- } else {
- // if the FK references a single-column PK, 'referencedColumnName' is not required
- if (printBase) {
- // there is only a single join column here (just not the default name)
- pw.print(elementName);
- pw.print('=');
- this.printJoinColumnAnnotationOn(joinColumnName, null, pw);
- } else {
- // no JoinColumn annotation needed: the default 'name' and 'referencedColumnName' work
- }
- }
- pw.undent();
- }
- }
-
- /**
- * 'elementName' is either "joinColumns" or "inverseJoinColumns"
- */
- private void printJoinTableJoinColumnAnnotationsOn(String elementName, ForeignKey foreignKey, EntitySourceWriter pw) {
- pw.print(elementName);
- pw.print('=');
- if (foreignKey.columnPairsSize() > 1) {
- pw.print('{');
- pw.println();
- pw.indent();
- }
- this.printJoinColumnAnnotationsOn(foreignKey, pw);
- if (foreignKey.columnPairsSize() > 1) {
- pw.undent();
- pw.println();
- pw.print('}');
- pw.println();
- }
- }
-
-
- // ********** non-owned many-to-many fields **********
-
- private void printEntityNonOwnedManyToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityNonOwnedManyToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printNonOwnedManyToManyAnnotationOn(relation, pw);
- }
- this.printCollectionFieldOn(fieldName, this.fullyQualify(relation.getOwningEntityName()), pw);
- }
-
- private void printNonOwnedManyToManyAnnotationOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_MANY);
- pw.print("(mappedBy=\""); //$NON-NLS-1$
- pw.print(relation.getMappedBy());
- pw.print("\")"); //$NON-NLS-1$
- pw.println();
- }
-
-
- // ********** misc **********
-
- private void printSerialVersionUIDFieldOn(EntitySourceWriter pw) {
- if (this.config.generateSerialVersionUID()) {
- pw.print("private static final long serialVersionUID = 1L;"); //$NON-NLS-1$
- pw.println();
- }
- }
-
- private void printZeroArgumentConstructorOn(String ctorName, String visibility, EntitySourceWriter pw) {
- if (this.config.generateDefaultConstructor()) {
- pw.printVisibility(visibility);
- pw.print(ctorName);
- pw.print("() {"); //$NON-NLS-1$
- pw.println();
- pw.indent();
- pw.println("super();"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
- }
-
-
- // ********** primary key properties **********
-
- private void printEntityPrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- if (this.primaryKeyClassIsRequired() && this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEntityEmbeddedIdPrimaryKeyPropertyOn(pw);
- } else {
- this.printEntityReadOnlyPrimaryKeyPropertiesOn(pw);
- this.printEntityWritablePrimaryKeyPropertiesOn(pw);
- }
- }
-
- private void printEntityEmbeddedIdPrimaryKeyPropertyOn(EntitySourceWriter pw) {
- if (this.config.propertyAccessType()) {
- pw.printAnnotation(JPA.EMBEDDED_ID);
- pw.println();
- }
- this.printPropertyOn(this.genTable.getAttributeNameForEmbeddedId(), this.pkClassName, pw);
- }
-
- private void printEntityReadOnlyPrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, true, true); // true=read-only; true=print ID annotation on getters
- }
-
- private void printEntityWritablePrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, false, true); // false=writable; true=print ID annotation on getters
- }
-
- private void printPrimaryKeyPropertiesOn(EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.primaryKeyColumns(readOnly); stream.hasNext(); ) {
- this.printPrimaryKeyPropertyOn(stream.next(), pw, readOnly, printIdAnnotation);
- }
- }
-
- // TODO if the property's type is java.util/sql.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the property must be an integral type
- private void printPrimaryKeyPropertyOn(Column column, EntitySourceWriter pw, boolean readOnly, boolean printIdAnnotation) {
- String propertyName = this.genTable.getAttributeNameFor(column);
- if (this.config.propertyAccessType()) {
- if (printIdAnnotation) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- }
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(propertyName, column);
- if (readOnly) {
- this.printReadOnlyColumnAnnotationOn(columnName, pw);
- } else {
- this.printColumnAnnotationOn(columnName, pw);
- }
- }
- this.printPropertyOn(propertyName, column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
-
- // ********** basic properties **********
-
- private void printEntityNonPrimaryKeyBasicPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) {
- this.printEntityNonPrimaryKeyBasicPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonPrimaryKeyBasicPropertyOn(Column column, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(column);
- if (this.config.propertyAccessType()) {
- String columnName = this.config.getDatabaseAnnotationNameBuilder().buildColumnAnnotationName(propertyName, column);
- this.printColumnAnnotationOn(columnName, pw);
- }
- this.printPropertyOn(propertyName, column.getJavaTypeDeclaration(), pw);
- }
-
-
- // ********** many-to-one properties **********
-
- private void printEntityManyToOnePropertiesOn(EntitySourceWriter pw) {
- for (Iterator<ManyToOneRelation> stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) {
- this.printEntityManyToOnePropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityManyToOnePropertyOn(ManyToOneRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printManyToOneAnnotationOn(propertyName, relation, pw);
- }
- String typeDeclaration = this.fullyQualify(relation.getReferencedEntityName());
- this.printPropertyOn(propertyName, typeDeclaration, pw);
- }
-
-
- // ********** one-to-many properties **********
-
- private void printEntityOneToManyPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<OneToManyRelation> stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) {
- this.printEntityOneToManyPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityOneToManyPropertyOn(OneToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printOneToManyAnnotationOn(relation, pw);
- }
- String elementTypeDeclaration = this.fullyQualify(relation.getReferencedEntityName());
- this.printCollectionPropertyOn(propertyName, elementTypeDeclaration, pw);
- }
-
-
- // ********** owned many-to-many properties **********
-
- private void printEntityOwnedManyToManyPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityOwnedManyToManyPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityOwnedManyToManyPropertyOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printOwnedManyToManyAnnotationOn(propertyName, relation, pw);
- }
- String elementTypeDeclaration = this.fullyQualify(relation.getNonOwningEntityName());
- this.printCollectionPropertyOn(propertyName, elementTypeDeclaration, pw);
- }
-
-
- // ********** non-owned many-to-many properties **********
-
- private void printEntityNonOwnedManyToManyPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityNonOwnedManyToManyPropertyOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonOwnedManyToManyPropertyOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.getAttributeNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printNonOwnedManyToManyAnnotationOn(relation, pw);
- }
- String elementTypeDeclaration = this.fullyQualify(relation.getOwningEntityName());
- this.printCollectionPropertyOn(propertyName, elementTypeDeclaration, pw);
- }
-
-
- // ********** compound primary key class **********
-
- private void printPrimaryKeyClassOn(EntitySourceWriter pw) {
- pw.println();
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- pw.printAnnotation(JPA.EMBEDDABLE);
- pw.println();
- }
- pw.print("public static class "); //$NON-NLS-1$
- pw.print(this.config.getPrimaryKeyMemberClassName());
- pw.print(" implements "); //$NON-NLS-1$
- pw.printTypeDeclaration(Serializable.class.getName());
- pw.print(" {"); //$NON-NLS-1$
- pw.println();
-
- pw.indent();
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEmbeddableReadOnlyPrimaryKeyFieldsOn(pw);
- this.printEmbeddableWritablePrimaryKeyFieldsOn(pw);
- } else {
- this.printIdFieldsOn(pw);
- }
- this.printSerialVersionUIDFieldOn(pw);
- pw.println();
- this.printZeroArgumentConstructorOn(this.config.getPrimaryKeyMemberClassName(), "public", pw); //$NON-NLS-1$
-
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEmbeddableReadOnlyPrimaryKeyPropertiesOn(pw);
- this.printEmbeddableWritablePrimaryKeyPropertiesOn(pw);
- } else {
- this.printIdPropertiesOn(pw);
- }
- }
-
- this.printPrimaryKeyEqualsMethodOn(this.config.getPrimaryKeyMemberClassName(), this.getTable().primaryKeyColumns(), pw);
- this.printPrimaryKeyHashCodeMethodOn(this.getTable().primaryKeyColumns(), pw);
- pw.undent();
-
- pw.print('}');
- pw.println();
- pw.println();
- }
-
-
- // ********** compound primary key class fields **********
-
- private void printEmbeddableReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, true, false); // true=read-only; false=do not print ID annotation on fields
- }
-
- private void printEmbeddableWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printPrimaryKeyFieldsOn(pw, false, false); // false=writable; false=do not print ID annotation on fields
- }
-
- private void printIdFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.getTable().primaryKeyColumns(); stream.hasNext(); ) {
- this.printIdFieldOn(stream.next(), pw);
- }
- }
-
- private void printIdFieldOn(Column column, EntitySourceWriter pw) {
- this.printFieldOn(this.genTable.getAttributeNameFor(column), column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
-
- // ********** compound primary key class properties **********
-
- private void printEmbeddableReadOnlyPrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, true, false); // true=read-only; false=do not print ID annotation on getters
- }
-
- private void printEmbeddableWritablePrimaryKeyPropertiesOn(EntitySourceWriter pw) {
- this.printPrimaryKeyPropertiesOn(pw, false, false); // false=writable; false=do not print ID annotation on getters
- }
-
- private void printIdPropertiesOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.getTable().primaryKeyColumns(); stream.hasNext(); ) {
- this.printIdPropertyOn(stream.next(), pw);
- }
- }
-
- private void printIdPropertyOn(Column column, EntitySourceWriter pw) {
- this.printPropertyOn(this.genTable.getAttributeNameFor(column), column.getPrimaryKeyJavaTypeDeclaration(), pw);
- }
-
-
- // ********** compound primary key class equals **********
-
- private void printPrimaryKeyEqualsMethodOn(String className, Iterator<Column> columns, EntitySourceWriter pw) {
- pw.printAnnotation("java.lang.Override"); //$NON-NLS-1$
- pw.println();
-
- pw.println("public boolean equals(Object o) {"); //$NON-NLS-1$
- pw.indent();
- pw.println("if (o == this) {"); //$NON-NLS-1$
- pw.indent();
- pw.println("return true;"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
-
- pw.print("if ( ! (o instanceof "); //$NON-NLS-1$
- pw.print(className);
- pw.print(")) {"); //$NON-NLS-1$
- pw.println();
- pw.indent();
- pw.println("return false;"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
-
- pw.print(className);
- pw.print(" other = ("); //$NON-NLS-1$
- pw.print(className);
- pw.print(") o;"); //$NON-NLS-1$
- pw.println();
-
- pw.print("return "); //$NON-NLS-1$
- pw.indent();
- while (columns.hasNext()) {
- this.printPrimaryKeyEqualsClauseOn(columns.next(), pw);
- if (columns.hasNext()) {
- pw.println();
- pw.print("&& "); //$NON-NLS-1$
- }
- }
- pw.print(';');
- pw.println();
- pw.undent();
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printPrimaryKeyEqualsClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- JavaType javaType = column.getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveEqualsClauseOn(fieldName, pw);
- } else {
- this.printReferenceEqualsClauseOn(fieldName, pw);
- }
- }
-
- private void printPrimitiveEqualsClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" == other."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- }
-
- private void printReferenceEqualsClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(".equals(other."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- }
-
-
- // ********** compound primary key class hash code **********
-
- private void printPrimaryKeyHashCodeMethodOn(Iterator<Column> columns, EntitySourceWriter pw) {
- pw.printAnnotation("java.lang.Override"); //$NON-NLS-1$
- pw.println();
-
- pw.println("public int hashCode() {"); //$NON-NLS-1$
- pw.indent();
- pw.println("final int prime = 31;"); //$NON-NLS-1$
- pw.println("int hash = 17;"); //$NON-NLS-1$
- while (columns.hasNext()) {
- pw.print("hash = hash * prime + "); //$NON-NLS-1$
- this.printPrimaryKeyHashCodeClauseOn(columns.next(), pw);
- pw.print(';');
- pw.println();
- }
- pw.println("return hash;"); //$NON-NLS-1$
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printPrimaryKeyHashCodeClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.getAttributeNameFor(column);
- JavaType javaType = column.getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveHashCodeClauseOn(javaType.getElementTypeName(), fieldName, pw);
- } else {
- this.printReferenceHashCodeClauseOn(fieldName, pw);
- }
- }
-
- private void printPrimitiveHashCodeClauseOn(String primitiveName, String fieldName, EntitySourceWriter pw) {
- if (primitiveName.equals("int")) { //$NON-NLS-1$
- // this.value
- pw.print("this."); //$NON-NLS-1$
- pw.print(fieldName);
- } else if (primitiveName.equals("short") //$NON-NLS-1$
- || primitiveName.equals("byte") //$NON-NLS-1$
- || primitiveName.equals("char")) { //$NON-NLS-1$
- // ((int) this.value) - explicit cast
- pw.print("((int) this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- } else if (primitiveName.equals("long")) { // cribbed from Long#hashCode() //$NON-NLS-1$
- // ((int) (this.value ^ (this.value >>> 32)))
- pw.print("((int) (this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" ^ (this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" >>> 32)))"); //$NON-NLS-1$
- } else if (primitiveName.equals("float")) { // cribbed from Float#hashCode() //$NON-NLS-1$
- // java.lang.Float.floatToIntBits(this.value)
- pw.printTypeDeclaration("java.lang.Float"); //$NON-NLS-1$
- pw.print(".floatToIntBits(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(')');
- } else if (primitiveName.equals("double")) { // cribbed from Double#hashCode() //$NON-NLS-1$
- // ((int) (java.lang.Double.doubleToLongBits(this.value) ^ (java.lang.Double.doubleToLongBits(this.value) >>> 32)))
- pw.print("((int) ("); //$NON-NLS-1$
- pw.printTypeDeclaration("java.lang.Double"); //$NON-NLS-1$
- pw.print(".doubleToLongBits(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(") ^ ("); //$NON-NLS-1$
- pw.printTypeDeclaration("java.lang.Double"); //$NON-NLS-1$
- pw.print(".doubleToLongBits(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(") >>> 32)))"); //$NON-NLS-1$
- } else if (primitiveName.equals("boolean")) { //$NON-NLS-1$
- // (this.value ? 1 : 0)
- pw.print("(this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(" ? 1 : 0)"); //$NON-NLS-1$
- } else {
- throw new IllegalArgumentException(primitiveName);
- }
- }
-
- private void printReferenceHashCodeClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("this."); //$NON-NLS-1$
- pw.print(fieldName);
- pw.print(".hashCode()"); //$NON-NLS-1$
- }
-
-
- // ********** package and imports **********
-
- private void printPackageAndImportsOn(PrintWriter pw, BodySource bodySource) {
- if (this.getPackageName().length() != 0) {
- pw.print("package "); //$NON-NLS-1$
- pw.print(this.getPackageName());
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- for (Iterator<Map.Entry<String, String>> stream = bodySource.importEntries(); stream.hasNext(); ) {
- Map.Entry<String, String> entry = stream.next();
- pw.print("import "); //$NON-NLS-1$
- pw.print(entry.getValue()); // package
- pw.print('.');
- pw.print(entry.getKey()); // short class name
- pw.print(';');
- pw.println();
- }
- pw.println();
- }
-
-
- // ********** fields **********
-
- /**
- * visibility is set in the config
- */
- private void printFieldOn(String fieldName, String typeDeclaration, EntitySourceWriter pw) {
- pw.printField(
- fieldName,
- typeDeclaration,
- this.config.getFieldVisibilityClause()
- );
- }
-
- /**
- * visibility and collection type are set in the config
- */
- private void printCollectionFieldOn(String fieldName, String elementTypeDeclaration, EntitySourceWriter pw) {
- pw.printParameterizedField(
- fieldName,
- this.config.getCollectionTypeName(),
- elementTypeDeclaration,
- this.config.getFieldVisibilityClause()
- );
- }
-
-
- // ********** properties **********
-
- /**
- * visibility is set in the config
- */
- private void printPropertyOn(String propertyName, String typeDeclaration, EntitySourceWriter pw) {
- pw.printGetterAndSetter(
- propertyName,
- typeDeclaration,
- this.config.getMethodVisibilityClause()
- );
- }
-
- /**
- * visibility and collection type are set in the config
- */
- private void printCollectionPropertyOn(String propertyName, String elementTypeDeclaration, EntitySourceWriter pw) {
- pw.printCollectionGetterAndSetter(
- propertyName,
- this.config.getCollectionTypeName(),
- elementTypeDeclaration,
- this.config.getMethodVisibilityClause()
- );
- }
-
-
- // ********** convenience methods **********
-
- private String getPackageName() {
- return this.packageFragment.getElementName();
- }
-
- private Table getTable() {
- return this.genTable.getTable();
- }
-
- private String getEntityName() {
- return this.genTable.getEntityName();
- }
-
- private boolean primaryKeyClassIsRequired() {
- return this.getTable().primaryKeyColumnsSize() > 1;
- }
-
- private String fullyQualify(String shortClassName) {
- String pkg = this.getPackageName();
- return (pkg.length() == 0) ? shortClassName : pkg + '.' + shortClassName;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.genTable.getName() + " => " + this.entityClassName); //$NON-NLS-1$
- }
-
-
- // ********** source writer **********
-
- private interface BodySource {
-
- /**
- * return a sorted set of map entries; the key is the short class name,
- * the value is the package name
- */
- Iterator<Map.Entry<String, String>> importEntries();
-
- /**
- * return the body source code
- */
- String getSource();
-
- /**
- * return the length of the body source code
- */
- int length();
-
- }
-
- /**
- * Extend IndentingPrintWriter with some methods that facilitate building
- * class source code.
- */
- private static class EntitySourceWriter extends IndentingPrintWriter implements BodySource {
- final String packageName;
- final String className;
- // key = short class name; value = package name
- private final Map<String, String> imports = new HashMap<String, String>();
-
- EntitySourceWriter(String packageName, String className) {
- super(new StringWriter(20000));
- this.packageName = packageName;
- this.className = className;
- }
-
- /**
- * Convert the specified string to a String Literal and print it,
- * adding the surrounding double-quotes and escaping characters
- * as necessary.
- */
- void printStringLiteral(String string) {
- StringTools.convertToJavaStringLiteralOn(string, this);
- }
-
- void printVisibility(String visibilityModifier) {
- if (visibilityModifier.length() != 0) {
- this.print(visibilityModifier);
- this.print(' ');
- }
- }
-
- void printAnnotation(String annotationName) {
- this.print('@');
- this.printTypeDeclaration(annotationName);
- }
-
- void printTypeDeclaration(String typeDeclaration) {
- this.print(this.buildImportedTypeDeclaration(typeDeclaration));
- }
-
- /**
- * Return the specified class's "imported" name.
- * The class declaration must be of the form:
- * "int"
- * "int[]" (not "[I")
- * "java.lang.Object"
- * "java.lang.Object[]" (not "[Ljava.lang.Object;")
- * "java.util.Map.Entry" (not "java.util.Map$Entry")
- * "java.util.Map.Entry[][]" (not "[[Ljava.util.Map$Entry;")
- */
- private String buildImportedTypeDeclaration(String typeDeclaration) {
- if (this.typeDeclarationIsMemberClass(typeDeclaration)) {
- // no need for an import, just return the partially-qualified name
- return this.buildMemberClassTypeDeclaration(typeDeclaration);
- }
- int last = typeDeclaration.lastIndexOf('.');
- String pkg = (last == -1) ? "" : typeDeclaration.substring(0, last); //$NON-NLS-1$
- String shortTypeDeclaration = typeDeclaration.substring(last + 1);
- String shortElementTypeName = shortTypeDeclaration;
- while (shortElementTypeName.endsWith("[]")) { //$NON-NLS-1$
- shortElementTypeName = shortElementTypeName.substring(0, shortElementTypeName.length() - 2);
- }
- String prev = this.imports.get(shortElementTypeName);
- if (prev == null) {
- // this is the first class with this short element type name
- this.imports.put(shortElementTypeName, pkg);
- return shortTypeDeclaration;
- }
- if (prev.equals(pkg)) {
- // this element type has already been imported
- return shortTypeDeclaration;
- }
- // another class with the same short element type name has been
- // previously imported, so this one must be used fully-qualified
- return typeDeclaration;
- }
-
- /**
- * e.g. "foo.bar.Employee.PK" will return true
- */
- private boolean typeDeclarationIsMemberClass(String typeDeclaration) {
- return (typeDeclaration.length() > this.className.length())
- && typeDeclaration.startsWith(this.className)
- && (typeDeclaration.charAt(this.className.length()) == '.');
- }
-
- /**
- * e.g. "foo.bar.Employee.PK" will return "Employee.PK"
- * this prevents collisions with other imported classes (e.g. "joo.jar.PK")
- */
- private String buildMemberClassTypeDeclaration(String typeDeclaration) {
- int index = this.packageName.length();
- if (index != 0) {
- index++; // bump past the '.'
- }
- return typeDeclaration.substring(index);
- }
-
- private Iterator<Map.Entry<String, String>> sortedImportEntries() {
- TreeSet<Map.Entry<String, String>> sortedImports = new TreeSet<Map.Entry<String, String>>(this.buildImportEntriesComparator());
- sortedImports.addAll(this.imports.entrySet());
- return sortedImports.iterator();
- }
-
- private Comparator<Map.Entry<String, String>> buildImportEntriesComparator() {
- return new Comparator<Map.Entry<String, String>>() {
- public int compare(Map.Entry<String, String> e1, Map.Entry<String, String> e2) {
- Collator collator = Collator.getInstance();
- int pkg = collator.compare(e1.getValue(), e2.getValue());
- return (pkg == 0) ? collator.compare(e1.getKey(), e2.getKey()) : pkg;
- }
- };
- }
-
- void printField(String fieldName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(fieldName);
- this.print(';');
- this.println();
- this.println();
- }
-
- void printParameterizedField(String fieldName, String typeDeclaration, String parameterTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print('<');
- this.printTypeDeclaration(parameterTypeDeclaration);
- this.print('>');
- this.print(' ');
- this.print(fieldName);
- this.print(';');
- this.println();
- this.println();
- }
-
- void printGetterAndSetter(String propertyName, String typeDeclaration, String visibility) {
- this.printGetter(propertyName, typeDeclaration, visibility);
- this.println();
- this.println();
-
- this.printSetter(propertyName, typeDeclaration, visibility);
- this.println();
- this.println();
- }
-
- private void printGetter(String propertyName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(typeDeclaration.equals("boolean") ? "is" : "get"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- this.print(StringTools.capitalize(propertyName));
- this.print("() {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("return this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- private void printSetter(String propertyName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.print("void set"); //$NON-NLS-1$
- this.print(StringTools.capitalize(propertyName));
- this.print('(');
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(propertyName);
- this.print(") {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(" = "); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- void printCollectionGetterAndSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printCollectionGetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility);
- this.println();
- this.println();
-
- this.printCollectionSetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility);
- this.println();
- this.println();
- }
-
- private void printCollectionGetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(collectionTypeDeclaration);
- this.print('<');
- this.printTypeDeclaration(elementTypeDeclaration);
- this.print("> get"); //$NON-NLS-1$
- this.print(StringTools.capitalize(propertyName));
- this.print("() {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("return this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- private void printCollectionSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.print("void set"); //$NON-NLS-1$
- this.print(StringTools.capitalize(propertyName));
- this.print('(');
- this.printTypeDeclaration(collectionTypeDeclaration);
- this.print('<');
- this.printTypeDeclaration(elementTypeDeclaration);
- this.print('>');
- this.print(' ');
- this.print(propertyName);
- this.print(") {"); //$NON-NLS-1$
- this.println();
-
- this.indent();
- this.print("this."); //$NON-NLS-1$
- this.print(propertyName);
- this.print(" = "); //$NON-NLS-1$
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
-
- // ********** BodySource implementation **********
-
- public Iterator<Map.Entry<String, String>> importEntries() {
- return new FilteringIterator<Map.Entry<String, String>, Map.Entry<String, String>>(this.sortedImportEntries()) {
- @Override
- protected boolean accept(Map.Entry<String, String> next) {
- String pkg = next.getValue();
- if (pkg.equals("") //$NON-NLS-1$
- || pkg.equals("java.lang") //$NON-NLS-1$
- || pkg.equals(EntitySourceWriter.this.packageName)) {
- return false;
- }
- return true;
- }
- };
- }
-
- public String getSource() {
- return this.out.toString();
- }
-
- public int length() {
- return ((StringWriter) this.out).getBuffer().length();
- }
-
- }
-
-
- // ********** config **********
-
- public static class Config {
- private boolean convertToJavaStyleIdentifiers = true;
-
- private boolean propertyAccessType = false; // as opposed to "field"
-
- private String collectionTypeName = Set.class.getName();
- private String collectionAttributeNameSuffix = "Collection"; // e.g. "private Set<Foo> fooCollection" //$NON-NLS-1$
-
- private int fieldVisibility = Modifier.PRIVATE;
- private int methodVisibility = Modifier.PUBLIC;
-
- private boolean generateGettersAndSetters = true;
- private boolean generateDefaultConstructor = true;
-
- private boolean serializable = true;
- private boolean generateSerialVersionUID = true;
-
- private boolean generateEmbeddedIdForCompoundPK = true; // as opposed to IdClass
- private String embeddedIdAttributeName = "pk"; //$NON-NLS-1$
- private String primaryKeyMemberClassName = "PK"; //$NON-NLS-1$
-
- /**
- * key = table
- * value = entity name
- */
- private HashMap<Table, String> tables = new HashMap<Table, String>();
-
- private DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder = DatabaseAnnotationNameBuilder.Default.INSTANCE;
-
- private OverwriteConfirmer overwriteConfirmer = OverwriteConfirmer.Never.INSTANCE;
-
- public static final int PRIVATE = 0;
- public static final int PACKAGE = 1;
- public static final int PROTECTED = 2;
- public static final int PUBLIC = 3;
-
-
- public boolean convertToJavaStyleIdentifiers() {
- return this.convertToJavaStyleIdentifiers;
- }
- public void setConvertToJavaStyleIdentifiers(boolean convertToJavaStyleIdentifiers) {
- this.convertToJavaStyleIdentifiers = convertToJavaStyleIdentifiers;
- }
-
- public boolean propertyAccessType() {
- return this.propertyAccessType;
- }
- public void setPropertyAccessType(boolean propertyAccessType) {
- this.propertyAccessType = propertyAccessType;
- }
-
- public boolean fieldAccessType() {
- return ! this.propertyAccessType;
- }
- public void setFieldAccessType(boolean fieldAccessType) {
- this.propertyAccessType = ! fieldAccessType;
- }
-
- public String getCollectionTypeName() {
- return this.collectionTypeName;
- }
- public void setCollectionTypeName(String collectionTypeName) {
- this.checkRequiredString(collectionTypeName, "collection type name is required"); //$NON-NLS-1$
- this.collectionTypeName = collectionTypeName;
- }
-
- public String getCollectionAttributeNameSuffix() {
- return this.collectionAttributeNameSuffix;
- }
- public void setCollectionAttributeNameSuffix(String collectionAttributeNameSuffix) {
- this.collectionAttributeNameSuffix = collectionAttributeNameSuffix;
- }
-
- public int getFieldVisibility() {
- return this.fieldVisibility;
- }
- /** entity fields cannot be 'public' */
- public void setFieldVisibility(int fieldVisibility) {
- switch (fieldVisibility) {
- case PRIVATE:
- case PACKAGE:
- case PROTECTED:
- this.fieldVisibility = fieldVisibility;
- break;
- default:
- throw new IllegalArgumentException("invalid field visibility: " + fieldVisibility); //$NON-NLS-1$
- }
- }
- String getFieldVisibilityClause() {
- switch (this.fieldVisibility) {
- case PRIVATE:
- return "private"; //$NON-NLS-1$
- case PACKAGE:
- return ""; //$NON-NLS-1$
- case PROTECTED:
- return "protected"; //$NON-NLS-1$
- default:
- throw new IllegalStateException("invalid field visibility: " + this.fieldVisibility); //$NON-NLS-1$
- }
- }
-
- public int getMethodVisibility() {
- return this.methodVisibility;
- }
- /** entity properties must be 'public' or 'protected' */
- public void setMethodVisibility(int methodVisibility) {
- switch (methodVisibility) {
- case PROTECTED:
- case PUBLIC:
- this.methodVisibility = methodVisibility;
- break;
- default:
- throw new IllegalArgumentException("invalid method visibility: " + methodVisibility); //$NON-NLS-1$
- }
- }
- String getMethodVisibilityClause() {
- switch (this.methodVisibility) {
- case PROTECTED:
- return "protected"; //$NON-NLS-1$
- case PUBLIC:
- return "public"; //$NON-NLS-1$
- default:
- throw new IllegalStateException("invalid method visibility: " + this.methodVisibility); //$NON-NLS-1$
- }
- }
-
- public boolean generateGettersAndSetters() {
- return this.generateGettersAndSetters;
- }
- public void setGenerateGettersAndSetters(boolean generateGettersAndSetters) {
- this.generateGettersAndSetters = generateGettersAndSetters;
- }
-
- public boolean generateDefaultConstructor() {
- return this.generateDefaultConstructor;
- }
- public void setGenerateDefaultConstructor(boolean generateDefaultConstructor) {
- this.generateDefaultConstructor = generateDefaultConstructor;
- }
-
- public boolean serializable() {
- return this.serializable;
- }
- public void setSerializable(boolean serializable) {
- this.serializable = serializable;
- }
-
- public boolean generateSerialVersionUID() {
- return this.generateSerialVersionUID;
- }
- public void setGenerateSerialVersionUID(boolean generateSerialVersionUID) {
- this.generateSerialVersionUID = generateSerialVersionUID;
- }
-
- public boolean generateEmbeddedIdForCompoundPK() {
- return this.generateEmbeddedIdForCompoundPK;
- }
- public void setGenerateEmbeddedIdForCompoundPK(boolean generateEmbeddedIdForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = generateEmbeddedIdForCompoundPK;
- }
-
- public boolean generateIdClassForCompoundPK() {
- return ! this.generateEmbeddedIdForCompoundPK;
- }
- public void setGenerateIdClassForCompoundPK(boolean generateIdClassForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = ! generateIdClassForCompoundPK;
- }
-
- public String getEmbeddedIdAttributeName() {
- return this.embeddedIdAttributeName;
- }
- public void setEmbeddedIdAttributeName(String embeddedIdAttributeName) {
- this.checkRequiredString(embeddedIdAttributeName, "EmbeddedId attribute name is required"); //$NON-NLS-1$
- this.embeddedIdAttributeName = embeddedIdAttributeName;
- }
-
- public String getPrimaryKeyMemberClassName() {
- return this.primaryKeyMemberClassName;
- }
- public void setPrimaryKeyMemberClassName(String primaryKeyMemberClassName) {
- this.checkRequiredString(primaryKeyMemberClassName, "primary key member class name is required"); //$NON-NLS-1$
- this.primaryKeyMemberClassName = primaryKeyMemberClassName;
- }
-
- String getEntityName(Table table) {
- return this.tables.get(table);
- }
- Iterator<Table> tables() {
- return this.tables.keySet().iterator();
- }
- int tablesSize() {
- return this.tables.size();
- }
- public void addTable(Table table, String entityName) {
- if (table == null) {
- throw new NullPointerException("table is required"); //$NON-NLS-1$
- }
- this.checkRequiredString(entityName, "entity name is required"); //$NON-NLS-1$
- if (this.tables.containsKey(table)) {
- throw new IllegalArgumentException("duplicate table: " + table.getName()); //$NON-NLS-1$
- }
- if (this.tables.values().contains(entityName)) {
- throw new IllegalArgumentException("duplicate entity name: " + entityName); //$NON-NLS-1$
- }
- if ( ! NameTools.stringConsistsOfJavaIdentifierCharacters(entityName)) {
- throw new IllegalArgumentException("entity name is not a valid Java identifier: " + entityName); //$NON-NLS-1$
- }
- if (NameTools.JAVA_RESERVED_WORDS_SET.contains(entityName)) {
- throw new IllegalArgumentException("entity name is a Java reserved word: " + entityName); //$NON-NLS-1$
- }
- this.tables.put(table, entityName);
- }
-
- public DatabaseAnnotationNameBuilder getDatabaseAnnotationNameBuilder() {
- return this.databaseAnnotationNameBuilder;
- }
- public void setDatabaseAnnotationNameBuilder(DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder) {
- if (databaseAnnotationNameBuilder == null) {
- throw new NullPointerException("database annotation name builder is required"); //$NON-NLS-1$
- }
- this.databaseAnnotationNameBuilder = databaseAnnotationNameBuilder;
- }
-
- public OverwriteConfirmer getOverwriteConfirmer() {
- return this.overwriteConfirmer;
- }
- public void setOverwriteConfirmer(OverwriteConfirmer overwriteConfirmer) {
- if (overwriteConfirmer == null) {
- throw new NullPointerException("overwrite confirmer is required"); //$NON-NLS-1$
- }
- this.overwriteConfirmer = overwriteConfirmer;
- }
-
- private void checkRequiredString(String string, String message) {
- if ((string == null) || (string.length() == 0)) {
- throw new IllegalArgumentException(message);
- }
- }
-
- }
-
-
- // ********** overwrite confirmer **********
-
- public static interface OverwriteConfirmer {
- /**
- * Return whether the entity generator should overwrite the specified
- * file.
- */
- boolean overwrite(String className);
-
-
- final class Always implements OverwriteConfirmer {
- public static final OverwriteConfirmer INSTANCE = new Always();
- public static OverwriteConfirmer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Always() {
- super();
- }
- // everything will be overwritten
- public boolean overwrite(String arg0) {
- return true;
- }
- @Override
- public String toString() {
- return "OverwriteConfirmer.Always"; //$NON-NLS-1$
- }
- }
-
-
- final class Never implements OverwriteConfirmer {
- public static final OverwriteConfirmer INSTANCE = new Never();
- public static OverwriteConfirmer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Never() {
- super();
- }
- // nothing will be overwritten
- public boolean overwrite(String arg0) {
- return false;
- }
- @Override
- public String toString() {
- return "OverwriteConfirmer.Never"; //$NON-NLS-1$
- }
- }
-
- }
-
-
- // ********** annotation name builder **********
-
- /**
- * Provide a pluggable way to determine whether and how the entity generator
- * prints the names of various database objects.
- */
- public static interface DatabaseAnnotationNameBuilder {
-
- /**
- * Given the name of an entity and the table to which it is mapped,
- * build and return a string to be used as the value for the entity's
- * Table annotation's 'name' element. Return null if the entity
- * maps to the table by default.
- */
- String buildTableAnnotationName(String entityName, Table table);
-
- /**
- * Given the name of an attribute (field or property) and the column
- * to which it is mapped,
- * build and return a string to be used as the value for the attribute's
- * Column annotation's 'name' element. Return null if the attribute
- * maps to the column by default.
- */
- String buildColumnAnnotationName(String attributeName, Column column);
-
- /**
- * Given the name of an attribute (field or property) and the
- * many-to-one or many-to-many foreign key to which it is mapped,
- * build and return a string to be used as the value for the attribute's
- * JoinColumn annotation's 'name' element. Return null if the attribute
- * maps to the join column by default.
- * The specified foreign key consists of a single column pair whose
- * referenced column is the single-column primary key of the foreign
- * key's referenced table.
- */
- String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey);
-
- /**
- * Build and return a string to be used as the value for a JoinColumn
- * annotation's 'name' or 'referencedColumnName' element.
- * This is called for many-to-one and many-to-many mappings when
- * the default join column name and/or referenced column name are/is
- * not applicable.
- * @see buildJoinColumnAnnotationName(String, ForeignKey)
- */
- String buildJoinColumnAnnotationName(Column column);
-
- /**
- * Build and return a string to be used as the value for a JoinTable
- * annotation's 'name' element.
- * This is called for many-to-many mappings when the default
- * join table name is not applicable.
- */
- String buildJoinTableAnnotationName(Table table);
-
-
- /**
- * The default implementation simple returns the database object's name,
- * unaltered.
- */
- final class Default implements DatabaseAnnotationNameBuilder {
- public static final DatabaseAnnotationNameBuilder INSTANCE = new Default();
- public static DatabaseAnnotationNameBuilder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public String buildTableAnnotationName(String entityName, Table table) {
- return table.getName();
- }
- public String buildColumnAnnotationName(String attributeName, Column column) {
- return column.getName();
- }
- public String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey) {
- return foreignKey.getColumnPair().getBaseColumn().getName();
- }
- public String buildJoinColumnAnnotationName(Column column) {
- return column.getName();
- }
- public String buildJoinTableAnnotationName(Table table) {
- return table.getName();
- }
- @Override
- public String toString() {
- return "DatabaseAnnotationNameBuilder.Default"; //$NON-NLS-1$
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java
deleted file mode 100644
index 09a74fb3bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- * Build a GenTable for each db.Table passed in.
- * Determine all the relations among the tables in the scope:
- * many-to-many
- * many-to-one
- * one-to-many
- * Make a first pass to determine each entity table's Java attribute names,
- * because we will need them on subsequent passes.
- */
-class GenScope {
- private final EntityGenerator.Config entityConfig;
- private final HashMap<Table, GenTable> genTables;
-
-
- // ********** construction/initialization **********
-
- GenScope(EntityGenerator.Config entityConfig, IProgressMonitor progressMonitor) {
- super();
- this.entityConfig = entityConfig;
- this.genTables = new HashMap<Table, GenTable>(entityConfig.tablesSize());
- SubMonitor sm = SubMonitor.convert(progressMonitor, JptGenMessages.GenScope_taskName, 4);
-
- this.buildGenTables();
- sm.worked(1);
- this.checkCanceled(sm);
-
- this.buildManyToManyRelations();
- sm.worked(1);
- this.checkCanceled(sm);
-
- this.buildManyToOneRelations(); // this will also build the corresponding one-to-many relations
- sm.worked(1);
- this.checkCanceled(sm);
-
- this.buildAttributeNames();
- sm.worked(1);
- this.checkCanceled(sm);
- }
-
- private void buildGenTables() {
- for (Iterator<Table> stream = entityConfig.tables(); stream.hasNext(); ) {
- Table table = stream.next();
- this.genTables.put(table, new GenTable(this, table));
- }
- }
-
- /**
- * find all the "join" tables
- */
- private void buildManyToManyRelations() {
- for (Iterator<GenTable> stream = this.genTables(); stream.hasNext(); ) {
- stream.next().buildJoinTableRelation();
- }
-
- // revert any "join" table that is referenced by another table back to an "entity" table
- HashSet<GenTable> referencedGenTables = this.buildReferencedGenTables();
- for (Iterator<GenTable> stream = this.joinGenTables(); stream.hasNext(); ) {
- GenTable joinGenTable = stream.next();
- if (referencedGenTables.contains(joinGenTable)) {
- joinGenTable.clearJoinTableRelation();
- }
- }
- }
-
- /**
- * find all the many-to-one and corresponding one-to-many relations
- */
- private void buildManyToOneRelations() {
- for (Iterator<GenTable> stream = this.entityGenTables(); stream.hasNext(); ) {
- stream.next().buildManyToOneRelations();
- }
- }
-
- /**
- * determine all the Java attribute names up-front because we will
- * need them for things like 'mappedBy' annotation elements
- */
- private void buildAttributeNames() {
- for (Iterator<GenTable> stream = this.entityGenTables(); stream.hasNext(); ) {
- stream.next().buildAttributeNames();
- }
- }
-
-
- // ********** package API **********
-
- EntityGenerator.Config getEntityConfig() {
- return this.entityConfig;
- }
-
- /**
- * return only the gen tables that are suitable for generating
- * entities (i.e. exclude the "join" tables)
- */
- Iterator<GenTable> entityGenTables() {
- return new FilteringIterator<GenTable, GenTable>(this.genTables()) {
- @Override
- protected boolean accept(GenTable genTable) {
- return ! genTable.isJoinTable();
- }
- };
- }
-
- int entityTablesSize() {
- return CollectionTools.size(this.entityGenTables());
- }
-
- /**
- * return the gen table corresponding to the specified db table;
- * return null if the gen table is not "in-scope" (e.g. a db foreign key
- * might have a reference to a db table that was not included in the
- * scope, so we won't have a corresponding gen table)
- */
- GenTable getGenTable(Table table) {
- return this.genTables.get(table);
- }
-
-
- // ********** internal methods **********
-
- private Iterator<GenTable> genTables() {
- return this.genTables.values().iterator();
- }
-
- private int genTablesSize() {
- return this.genTables.size();
- }
-
- /**
- * return only the "join" gen tables
- */
- private Iterator<GenTable> joinGenTables() {
- return new FilteringIterator<GenTable, GenTable>(this.genTables()) {
- @Override
- protected boolean accept(GenTable genTable) {
- return genTable.isJoinTable();
- }
- };
- }
-
- /**
- * build a set of the gen tables that are referenced by other gen tables
- * in the scope
- */
- private HashSet<GenTable> buildReferencedGenTables() {
- HashSet<GenTable> referencedGenTables = new HashSet<GenTable>(this.genTablesSize());
- for (Iterator<GenTable> stream = this.genTables(); stream.hasNext(); ) {
- stream.next().addReferencedGenTablesTo(referencedGenTables);
- }
- return referencedGenTables;
- }
-
- private void checkCanceled(IProgressMonitor progressMonitor) {
- if (progressMonitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.genTables);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java
deleted file mode 100644
index bef44e9842..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- * associate a table with the various relations that will be used when
- * generating the entity corresponding to the table
- */
-class GenTable {
- private final GenScope scope;
- private final Table table;
-
- // these relations cannot be built until after we have built all the scope's tables
- private ManyToManyRelation joinTableRelation;
- private final ArrayList<ManyToManyRelation> ownedManyToManyRelations = new ArrayList<ManyToManyRelation>();
- private final ArrayList<ManyToManyRelation> nonOwnedManyToManyRelations = new ArrayList<ManyToManyRelation>();
- private final ArrayList<ManyToOneRelation> manyToOneRelations = new ArrayList<ManyToOneRelation>();
- private final ArrayList<OneToManyRelation> oneToManyRelations = new ArrayList<OneToManyRelation>();
- private final HashSet<Column> foreignKeyColumns = new HashSet<Column>();
-
- // key=column/relation; value=entity attribute (field/property) name
- private final HashMap<Object, String> attributeNames = new HashMap<Object, String>();
- // key to 'attributeNames' for the optional embedded ID attribute name
- private static final Object EMBEDDED_ID_VIRTUAL_COLUMN = new Object();
-
-
- // ********** construction/initialization **********
-
- GenTable(GenScope scope, Table table) {
- super();
- this.scope = scope;
- this.table = table;
- }
-
-
- // ********** package API **********
-
- EntityGenerator.Config getEntityConfig() {
- return this.scope.getEntityConfig();
- }
-
- /**
- * examples:
- * GenTable(FOO) => "FOO_COLLECTION"
- * GenTable(foo) => "fooCollection"
- * GenTable(Foo) => "FooCollection"
- */
- String getCollectionAttributeName() {
- String name = this.getName();
- String suffix = this.getEntityConfig().getCollectionAttributeNameSuffix();
- if (StringTools.stringIsUppercase(name)) { // hmmm ~bjv
- suffix = '_' + suffix.toUpperCase();
- }
- return name + suffix;
- }
-
- /**
- * determine whether the table is a "join" table within the table's scope;
- * this can be removed, later, if we find another table references the,
- * seemingly, join table
- * @see #clearJoinTableRelation() (and callers)
- */
- void buildJoinTableRelation() {
- if ( ! this.table.isPossibleJoinTable()) {
- return; // the table must have exactly 2 foreign keys
- }
- ForeignKey owningFK = this.table.getJoinTableOwningForeignKey();
- GenTable owningGenTable = this.scope.getGenTable(owningFK.getReferencedTable());
- if (owningGenTable == null) {
- return; // both tables must be in the scope
- }
- ForeignKey nonOwningFK = this.table.getJoinTableNonOwningForeignKey();
- GenTable nonOwningGenTable = this.scope.getGenTable(nonOwningFK.getReferencedTable());
- if (nonOwningGenTable == null) {
- return; // both tables must be in the scope
- }
- this.joinTableRelation = new ManyToManyRelation(
- this,
- owningFK,
- owningGenTable,
- nonOwningFK,
- nonOwningGenTable
- );
- }
-
- /**
- * used by the scope to figure out whether "join" tables should be
- * converted to "entity" tables
- */
- void addReferencedGenTablesTo(Set<GenTable> referencedTables) {
- for (Iterator<ForeignKey> stream = this.table.foreignKeys(); stream.hasNext(); ) {
- ForeignKey fk = stream.next();
- GenTable genTable = this.scope.getGenTable(fk.getReferencedTable());
- if (genTable != null) {
- referencedTables.add(genTable);
- }
- }
- }
-
- /**
- * the scope clears the join table relation if there are any references
- * to the join table from other tables in the scope
- */
- void clearJoinTableRelation() {
- this.joinTableRelation.clear();
- this.joinTableRelation = null;
- }
-
- /**
- * find "in-scope" foreign keys
- */
- void buildManyToOneRelations() {
- for (Iterator<ForeignKey> stream = this.table.foreignKeys(); stream.hasNext(); ) {
- ForeignKey fk = stream.next();
- GenTable referencedGenTable = this.scope.getGenTable(fk.getReferencedTable());
- if (referencedGenTable != null) {
- this.manyToOneRelations.add(new ManyToOneRelation(this, fk, referencedGenTable));
- }
- }
- }
-
- /**
- * now that all the relations are in place, we can configure the Java
- * attribute names
- */
- void buildAttributeNames() {
- if ((this.table.primaryKeyColumnsSize() > 1) && this.getEntityConfig().generateEmbeddedIdForCompoundPK()) {
- // if we are going to generate an EmbeddedId attribute, add it to
- // 'attributeNames' so we don't collide with it later, when generating
- // attribute names for the columns etc.
- this.configureAttributeName(EMBEDDED_ID_VIRTUAL_COLUMN, this.getEntityConfig().getEmbeddedIdAttributeName());
- }
-
- // gather up all the table's columns...
- Set<Column> columns = CollectionTools.set(this.table.columns(), this.table.columnsSize());
- // ...remove the columns that belong exclusively to many-to-one foreign keys...
- this.buildManyToOneAttributeNames(columns);
- // ...and use the remaining columns to generate "basic" attribute names
- this.buildBasicAttributeNames(columns);
-
- this.buildOneToManyAttributeNames();
- this.buildOwnedManyToManyAttributeNames();
- this.buildNonOwnedManyToManyAttributeNames();
- }
-
- /**
- * return the columns that are part of the table's primary key
- * but are also part of an "in-scope" foreign key
- */
- Iterator<Column> readOnlyPrimaryKeyColumns() {
- return new FilteringIterator<Column, Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Column pkColumn) {
- return pkColumn.isForeignKeyColumn();
- }
- };
- }
-
- /**
- * return the columns that are part of the table's primary key
- * but are NOT part of any "in-scope" foreign key
- */
- Iterator<Column> writablePrimaryKeyColumns() {
- return new FilteringIterator<Column, Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Column pkColumn) {
- return ! pkColumn.isForeignKeyColumn();
- }
- };
- }
-
- /**
- * return the columns that NEITHER part of the table's primary key
- * NOR part of any foreign key
- */
- Iterator<Column> nonPrimaryKeyBasicColumns() {
- return new FilteringIterator<Column, Column>(this.table.columns()) {
- @Override
- protected boolean accept(Column column) {
- return ! (column.isPrimaryKeyColumn() || column.isForeignKeyColumn());
- }
- };
- }
-
- Table getTable() {
- return this.table;
- }
-
- String getEntityName() {
- return this.getEntityConfig().getEntityName(this.table);
- }
-
- boolean isJoinTable() {
- return this.joinTableRelation != null;
- }
-
- void addOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.ownedManyToManyRelations.add(relation);
- }
-
- void removeOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.ownedManyToManyRelations.remove(relation);
- }
-
- void addNonOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.nonOwnedManyToManyRelations.add(relation);
- }
-
- void removeNonOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.nonOwnedManyToManyRelations.remove(relation);
- }
-
- void addOneToManyRelation(OneToManyRelation relation) {
- this.oneToManyRelations.add(relation);
- }
-
- Iterator<ManyToOneRelation> manyToOneRelations() {
- return this.manyToOneRelations.iterator();
- }
-
- Iterator<OneToManyRelation> oneToManyRelations() {
- return this.oneToManyRelations.iterator();
- }
-
- Iterator<ManyToManyRelation> ownedManyToManyRelations() {
- return this.ownedManyToManyRelations.iterator();
- }
-
- Iterator<ManyToManyRelation> nonOwnedManyToManyRelations() {
- return this.nonOwnedManyToManyRelations.iterator();
- }
-
- /**
- * the key can be a column or relation or #EMBEDDED_ID_VIRTUAL_COLUMN
- */
- private String getAttributeNameFor_(Object o) {
- return this.attributeNames.get(o);
- }
-
- /**
- * this will return null if we don't want an embedded id attribute
- */
- String getAttributeNameForEmbeddedId() {
- return this.getAttributeNameFor_(EMBEDDED_ID_VIRTUAL_COLUMN);
- }
-
- String getAttributeNameFor(Column column) {
- return this.getAttributeNameFor_(column);
- }
-
- String getAttributeNameFor(ManyToOneRelation relation) {
- return this.getAttributeNameFor_(relation);
- }
-
- String getAttributeNameFor(OneToManyRelation relation) {
- return this.getAttributeNameFor_(relation);
- }
-
- String getAttributeNameFor(ManyToManyRelation relation) {
- return this.getAttributeNameFor_(relation);
- }
-
- String getName() {
- return this.table.getName();
- }
-
- boolean joinTableNameIsDefault() {
- return this.table.joinTableNameIsDefault();
- }
-
-
- // ********** internal API **********
-
- /**
- * while we are figuring out the names for the m:1 attributes, remove from the
- * specified set of columns the columns that are only part of the foreign keys
- * (leaving the remaining columns for basic attributes)
- */
- private void buildManyToOneAttributeNames(Set<Column> columns) {
- for (ManyToOneRelation relation : this.manyToOneRelations) {
- CollectionTools.removeAll(columns, relation.getForeignKey().nonPrimaryKeyBaseColumns());
- CollectionTools.addAll(this.foreignKeyColumns, relation.getForeignKey().baseColumns());
- relation.setMappedBy(this.configureAttributeName(relation, relation.getAttributeName()));
- }
- }
-
- /**
- * build a unique attribute name for the specified "basic" columns,
- * checking for name collisions
- */
- private void buildBasicAttributeNames(Set<Column> columns) {
- for (Column column : columns) {
- this.configureAttributeName(column, column.getName());
- }
- }
-
- private void buildOneToManyAttributeNames() {
- for (OneToManyRelation relation : this.oneToManyRelations) {
- this.configureAttributeName(relation, relation.getAttributeName());
- }
- }
-
- private void buildOwnedManyToManyAttributeNames() {
- for (ManyToManyRelation relation : this.ownedManyToManyRelations) {
- relation.setMappedBy(this.configureAttributeName(relation, relation.getOwnedAttributeName()));
- }
- }
-
- private void buildNonOwnedManyToManyAttributeNames() {
- for (ManyToManyRelation relation : this.nonOwnedManyToManyRelations) {
- this.configureAttributeName(relation, relation.getNonOwnedAttributeName());
- }
- }
-
- /**
- * Convert the specified attribute name to something unique for the entity,
- * converting it to something Java-like if the config flag is set.
- * Store the calculated name so we can get it back later, when we
- * are generating source.
- */
- private String configureAttributeName(Object o, String attributeName) {
- String result = attributeName;
- Collection<String> existingAttributeNames = this.attributeNames.values();
- if (this.getEntityConfig().convertToJavaStyleIdentifiers()) {
- result = EntityGenTools.convertToUniqueJavaStyleAttributeName(result, existingAttributeNames);
- } else {
- // first, convert the attribute name to a legal Java identifier
- result = NameTools.convertToJavaIdentifier(result);
- // then make sure it's unique
- result = NameTools.uniqueNameForIgnoreCase(attributeName, existingAttributeNames);
- }
- this.attributeNames.put(o, result);
- return result;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.table);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java
deleted file mode 100644
index 7f601e4253..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JPA.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-
-/**
- * JPA Java-related stuff (annotations etc.)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-// TODO move to utility?
-@SuppressWarnings("nls")
-public interface JPA {
-
- // JPA package
- String PACKAGE = "javax.persistence";
- String PACKAGE_ = PACKAGE + '.';
-
-
- // ********** API **********
-
- // JPA annotations
- String ASSOCIATION_OVERRIDE = PACKAGE_ + "AssociationOverride";
- String ASSOCIATION_OVERRIDE__NAME = "name";
- String ASSOCIATION_OVERRIDE__JOIN_COLUMNS = "joinColumns";
- String ASSOCIATION_OVERRIDES = PACKAGE_ + "AssociationOverrides";
- String ASSOCIATION_OVERRIDES__VALUE = "value";
- String ATTRIBUTE_OVERRIDE = PACKAGE_ + "AttributeOverride";
- String ATTRIBUTE_OVERRIDE__NAME = "name";
- String ATTRIBUTE_OVERRIDE__COLUMN = "column";
- String ATTRIBUTE_OVERRIDES = PACKAGE_ + "AttributeOverrides";
- String ATTRIBUTE_OVERRIDES__VALUE = "value";
- String BASIC = PACKAGE_ + "Basic";
- String BASIC__FETCH = "fetch";
- String BASIC__OPTIONAL = "optional";
- String COLUMN = PACKAGE_ + "Column";
- String COLUMN__NAME = "name";
- String COLUMN__UNIQUE = "unique";
- String COLUMN__NULLABLE = "nullable";
- String COLUMN__INSERTABLE = "insertable";
- String COLUMN__UPDATABLE = "updatable";
- String COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String COLUMN__TABLE = "table";
- String COLUMN__LENGTH = "length";
- String COLUMN__PRECISION = "precision";
- String COLUMN__SCALE = "scale";
- String COLUMN_RESULT = PACKAGE_ + "ColumnResult";
- String COLUMN_RESULT__NAME = "name";
- String DISCRIMINATOR_COLUMN = PACKAGE_ + "DiscriminatorColumn";
- String DISCRIMINATOR_COLUMN__NAME = "name";
- String DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType";
- String DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String DISCRIMINATOR_COLUMN__LENGTH = "length";
- String DISCRIMINATOR_VALUE = PACKAGE_ + "DiscriminatorValue";
- String DISCRIMINATOR_VALUE__VALUE = "value";
- String EMBEDDABLE = PACKAGE_ + "Embeddable";
- String EMBEDDED = PACKAGE_ + "Embedded";
- String EMBEDDED_ID = PACKAGE_ + "EmbeddedId";
- String ENTITY = PACKAGE_ + "Entity";
- String ENTITY__NAME = "name";
- String ENTITY_LISTENERS = PACKAGE_ + "EntityListeners";
- String ENTITY_LISTENERS__VALUE = "value";
- String ENTITY_RESULT = PACKAGE_ + "EntityResult";
- String ENTITY_RESULT__ENTITY_CLASS = "entityClass";
- String ENTITY_RESULT__FIELDS = "fields";
- String ENTITY_RESULT__DISCRIMINATOR_COLUMN = "discriminatorColumn";
- String ENUMERATED = PACKAGE_ + "Enumerated";
- String ENUMERATED__VALUE = "value";
- String EXCLUDE_DEFAULT_LISTENERS = PACKAGE_ + "ExcludeDefaultListeners";
- String EXCLUDE_SUPERCLASS_LISTENERS = PACKAGE_ + "ExcludeSuperclassListeners";
- String FIELD_RESULT = PACKAGE_ + "FieldResult";
- String FIELD_RESULT__NAME = "name";
- String FIELD_RESULT__COLUMN = "column";
- String FLUSH_MODE = PACKAGE_ + "FlushMode";
- String FLUSH_MODE__VALUE = "value";
- String GENERATED_VALUE = PACKAGE_ + "GeneratedValue";
- String GENERATED_VALUE__STRATEGY = "strategy";
- String GENERATED_VALUE__GENERATOR = "generator";
- String ID = PACKAGE_ + "Id";
- String ID_CLASS = PACKAGE_ + "IdClass";
- String ID_CLASS__VALUE = "value";
- String INHERITANCE = PACKAGE_ + "Inheritance";
- String INHERITANCE__STRATEGY = "strategy";
- String JOIN_COLUMN = PACKAGE_ + "JoinColumn";
- String JOIN_COLUMN__NAME = "name";
- String JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String JOIN_COLUMN__UNIQUE = "unique";
- String JOIN_COLUMN__NULLABLE = "nullable";
- String JOIN_COLUMN__INSERTABLE = "insertable";
- String JOIN_COLUMN__UPDATABLE = "updatable";
- String JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String JOIN_COLUMN__TABLE = "table";
- String JOIN_COLUMNS = PACKAGE_ + "JoinColumns";
- String JOIN_COLUMNS__VALUE = "value";
- String JOIN_TABLE = PACKAGE_ + "JoinTable";
- String JOIN_TABLE__NAME = "name";
- String JOIN_TABLE__CATALOG = "catalog";
- String JOIN_TABLE__SCHEMA = "schema";
- String JOIN_TABLE__JOIN_COLUMNS = "joinColumns";
- String JOIN_TABLE__INVERSE_JOIN_COLUMNS = "inverseJoinColumns";
- String JOIN_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String LOB = PACKAGE_ + "Lob";
- String MANY_TO_MANY = PACKAGE_ + "ManyToMany";
- String MANY_TO_MANY__TARGET_ENTITY = "targetEntity";
- String MANY_TO_MANY__CASCADE = "cascade";
- String MANY_TO_MANY__FETCH = "fetch";
- String MANY_TO_MANY__MAPPED_BY = "mappedBy";
- String MANY_TO_ONE = PACKAGE_ + "ManyToOne";
- String MANY_TO_ONE__TARGET_ENTITY = "targetEntity";
- String MANY_TO_ONE__CASCADE = "cascade";
- String MANY_TO_ONE__FETCH = "fetch";
- String MANY_TO_ONE__OPTIONAL = "optional";
- String MAP_KEY = PACKAGE_ + "MapKey";
- String MAP_KEY__NAME = "name";
- String MAPPED_SUPERCLASS = PACKAGE_ + "MappedSuperclass";
- String NAMED_NATIVE_QUERIES = PACKAGE_ + "NamedNativeQueries";
- String NAMED_NATIVE_QUERIES__VALUE = "value";
- String NAMED_NATIVE_QUERY = PACKAGE_ + "NamedNativeQuery";
- String NAMED_NATIVE_QUERY__NAME = "name";
- String NAMED_NATIVE_QUERY__QUERY = "query";
- String NAMED_NATIVE_QUERY__HINTS = "hints";
- String NAMED_NATIVE_QUERY__RESULT_CLASS = "resultClass";
- String NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = "resultSetMapping";
- String NAMED_QUERIES = PACKAGE_ + "NamedQueries";
- String NAMED_QUERIES__VALUE = "value";
- String NAMED_QUERY = PACKAGE_ + "NamedQuery";
- String NAMED_QUERY__NAME = "name";
- String NAMED_QUERY__QUERY = "query";
- String NAMED_QUERY__HINTS = "hints";
- String ONE_TO_MANY = PACKAGE_ + "OneToMany";
- String ONE_TO_MANY__TARGET_ENTITY = "targetEntity";
- String ONE_TO_MANY__CASCADE = "cascade";
- String ONE_TO_MANY__FETCH = "fetch";
- String ONE_TO_MANY__MAPPED_BY = "mappedBy";
- String ONE_TO_ONE = PACKAGE_ + "OneToOne";
- String ONE_TO_ONE__TARGET_ENTITY = "targetEntity";
- String ONE_TO_ONE__CASCADE = "cascade";
- String ONE_TO_ONE__FETCH = "fetch";
- String ONE_TO_ONE__OPTIONAL = "optional";
- String ONE_TO_ONE__MAPPED_BY = "mappedBy";
- String ORDER_BY = PACKAGE_ + "OrderBy";
- String ORDER_BY__VALUE = "value";
- String PERSISTENCE_CONTEXT = PACKAGE_ + "PersistenceContext";
- String PERSISTENCE_CONTEXT__NAME = "name";
- String PERSISTENCE_CONTEXT__UNIT_NAME = "unitName";
- String PERSISTENCE_CONTEXT__TYPE = "type";
- String PERSISTENCE_CONTEXTS = PACKAGE_ + "PersistenceContexts";
- String PERSISTENCE_CONTEXTS__VALUE = "value";
- String PERSISTENCE_UNIT = PACKAGE_ + "XmlPersistenceUnit";
- String PERSISTENCE_UNIT__NAME = "name";
- String PERSISTENCE_UNIT__UNIT_NAME = "unitName";
- String PERSISTENCE_UNITS = PACKAGE_ + "PersistenceUnits";
- String PERSISTENCE_UNITS__VALUE = "value";
- String POST_LOAD = PACKAGE_ + "PostLoad";
- String POST_PERSIST = PACKAGE_ + "PostPersist";
- String POST_REMOVE = PACKAGE_ + "PostRemove";
- String POST_UPDATE = PACKAGE_ + "PostUpdate";
- String PRE_PERSIST = PACKAGE_ + "PrePersist";
- String PRE_REMOVE = PACKAGE_ + "PreRemove";
- String PRE_UPDATE = PACKAGE_ + "PreUpdate";
- String PRIMARY_KEY_JOIN_COLUMN = PACKAGE_ + "PrimaryKeyJoinColumn";
- String PRIMARY_KEY_JOIN_COLUMN__NAME = "name";
- String PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String PRIMARY_KEY_JOIN_COLUMNS = PACKAGE_ + "PrimaryKeyJoinColumns";
- String PRIMARY_KEY_JOIN_COLUMNS__VALUE = "value";
- String QUERY_HINT = PACKAGE_ + "QueryHint";
- String QUERY_HINT__NAME = "name";
- String QUERY_HINT__VALUE = "value";
- String SECONDARY_TABLE = PACKAGE_ + "SecondaryTable";
- String SECONDARY_TABLE__NAME = "name";
- String SECONDARY_TABLE__CATALOG = "catalog";
- String SECONDARY_TABLE__SCHEMA = "schema";
- String SECONDARY_TABLE__PK_JOIN_COLUMNS = "pkJoinColumns";
- String SECONDARY_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String SECONDARY_TABLES = PACKAGE_ + "SecondaryTables";
- String SECONDARY_TABLES__VALUE = "value";
- String SEQUENCE_GENERATOR = PACKAGE_ + "SequenceGenerator";
- String SEQUENCE_GENERATOR__NAME = "name";
- String SEQUENCE_GENERATOR__SEQUENCE_NAME = "sequenceName";
- String SEQUENCE_GENERATOR__INITIAL_VALUE = "initialValue";
- String SEQUENCE_GENERATOR__ALLOCATION_SIZE = "allocationSize";
- String SQL_RESULT_SET_MAPPING = PACKAGE_ + "SqlResultSetMapping";
- String SQL_RESULT_SET_MAPPING__NAME = "name";
- String SQL_RESULT_SET_MAPPING__ENTITIES = "entities";
- String SQL_RESULT_SET_MAPPING__COLUMNS = "columns";
- String TABLE = PACKAGE_ + "Table";
- String TABLE__NAME = "name";
- String TABLE__CATALOG = "catalog";
- String TABLE__SCHEMA = "schema";
- String TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String TABLE_GENERATOR = PACKAGE_ + "TableGenerator";
- String TABLE_GENERATOR__NAME = "name";
- String TABLE_GENERATOR__TABLE = "table";
- String TABLE_GENERATOR__CATALOG = "catalog";
- String TABLE_GENERATOR__SCHEMA = "schema";
- String TABLE_GENERATOR__PK_COLUMN_NAME = "pkColumnName";
- String TABLE_GENERATOR__VALUE_COLUMN_NAME = "valueColumnName";
- String TABLE_GENERATOR__PK_COLUMN_VALUE = "pkColumnValue";
- String TABLE_GENERATOR__INITIAL_VALUE = "initialValue";
- String TABLE_GENERATOR__ALLOCATION_SIZE = "allocationSize";
- String TABLE_GENERATOR__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String TEMPORAL = PACKAGE_ + "Temporal";
- String TEMPORAL__VALUE = "value";
- String TRANSIENT = PACKAGE_ + "Transient";
- String UNIQUE_CONSTRAINT = PACKAGE_ + "UniqueConstraint";
- String UNIQUE_CONSTRAINT__COLUMN_NAMES = "columnNames";
- String VERSION = PACKAGE_ + "Version";
-
- // JPA enums
- String GENERATION_TYPE = PACKAGE_ + "GenerationType";
- String GENERATION_TYPE_ = GENERATION_TYPE + '.';
- String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO";
- String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY";
- String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE";
- String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE";
-
- String CASCADE_TYPE = PACKAGE_ + "CascadeType";
- String CASCADE_TYPE_ = CASCADE_TYPE + '.';
- String CASCADE_TYPE__ALL = CASCADE_TYPE_ + "ALL";
- String CASCADE_TYPE__MERGE = CASCADE_TYPE_ + "MERGE";
- String CASCADE_TYPE__PERSIST = CASCADE_TYPE_ + "PERSIST";
- String CASCADE_TYPE__REFRESH = CASCADE_TYPE_ + "REFRESH";
- String CASCADE_TYPE__REMOVE = CASCADE_TYPE_ + "REMOVE";
-
- String DISCRIMINATOR_TYPE = PACKAGE_ + "DiscriminatorType";
- String DISCRIMINATOR_TYPE_ = DISCRIMINATOR_TYPE + '.';
- String DISCRIMINATOR_TYPE__CHAR = DISCRIMINATOR_TYPE_ + "CHAR";
- String DISCRIMINATOR_TYPE__INTEGER = DISCRIMINATOR_TYPE_ + "INTEGER";
- String DISCRIMINATOR_TYPE__STRING = DISCRIMINATOR_TYPE_ + "STRING";
-
- String ENUM_TYPE = PACKAGE_ + "EnumType";
- String ENUM_TYPE_ = ENUM_TYPE + '.';
- String ENUM_TYPE__ORDINAL = ENUM_TYPE_ + "ORDINAL";
- String ENUM_TYPE__STRING = ENUM_TYPE_ + "STRING";
-
- String FETCH_TYPE = PACKAGE_ + "FetchType";
- String FETCH_TYPE_ = FETCH_TYPE + '.';
- String FETCH_TYPE__EAGER = FETCH_TYPE_ + "EAGER";
- String FETCH_TYPE__LAZY = FETCH_TYPE_ + "LAZY";
-
- String FLUSH_MODE_TYPE = PACKAGE_ + "FlushModeType";
- String FLUSH_MODE_TYPE_ = FLUSH_MODE_TYPE + '.';
- String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO";
- String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT";
-
- String INHERITANCE_TYPE = PACKAGE_ + "InheritanceType";
- String INHERITANCE_TYPE_ = INHERITANCE_TYPE + '.';
- String INHERITANCE_TYPE__JOINED = INHERITANCE_TYPE_ + "JOINED";
- String INHERITANCE_TYPE__SINGLE_TABLE = INHERITANCE_TYPE_ + "SINGLE_TABLE";
- String INHERITANCE_TYPE__TABLE_PER_CLASS = INHERITANCE_TYPE_ + "TABLE_PER_CLASS";
-
- String PERSISTENCE_CONTEXT_TYPE = PACKAGE_ + "PersistenceContextType";
- String PERSISTENCE_CONTEXT_TYPE_ = PERSISTENCE_CONTEXT_TYPE + '.';
- String PERSISTENCE_CONTEXT_TYPE__EXTENDED = PERSISTENCE_CONTEXT_TYPE_ + "EXTENDED";
- String PERSISTENCE_CONTEXT_TYPE__TRANSACTION = PERSISTENCE_CONTEXT_TYPE_ + "TRANSACTION";
-
- String TEMPORAL_TYPE = PACKAGE_ + "TemporalType";
- String TEMPORAL_TYPE_ = TEMPORAL_TYPE + '.';
- String TEMPORAL_TYPE__DATE = TEMPORAL_TYPE_ + "DATE";
- String TEMPORAL_TYPE__TIME = TEMPORAL_TYPE_ + "TIME";
- String TEMPORAL_TYPE__TIMESTAMP = TEMPORAL_TYPE_ + "TIMESTAMP";
-
- // JPA interfaces
- String ENTITY_MANAGER = PACKAGE_ + "EntityManager";
- String ENTITY_MANAGER_FACTORY = PACKAGE_ + "EntityManagerFactory";
- String ENTITY_TRANSACTION = PACKAGE_ + "EntityTransaction";
- String INSTRUMENTABLE_CLASS_LOADER = PACKAGE_ + "InstrumentableClassLoader";
- String QUERY = PACKAGE_ + "Query";
-
- // JPA classes
- String PERSISTENCE = PACKAGE_ + "XmlPersistence";
-
- // JPA exceptions
- String NON_UNIQUE_RESULT_EXCEPTION = PACKAGE_ + "NonUniqueResultException";
- String OBJECT_NOT_FOUND_EXCEPTION = PACKAGE_ + "ObjectNotFoundException";
- String PERSISTENCE_EXCEPTION = PACKAGE_ + "PersistenceException";
-
-
- // ********** SPI **********
-
- // JPA SPI package
- String SPI_PACKAGE = PACKAGE_ + "spi";
- String SPI_PACKAGE_ = SPI_PACKAGE + '.';
-
- // JPA SPI interfaces
- String ENTITY_MANAGER_FACTORY_PROVIDER = SPI_PACKAGE_ + "EntityManagerFactoryProvider";
- String PERSISTENCE_INFO = SPI_PACKAGE_ + "PersistenceInfo";
- String PERSISTENCE_PROVIDER = SPI_PACKAGE_ + "PersistenceProvider";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java
deleted file mode 100644
index bc3bbf0d38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali entity generation.
- */
-class JptGenMessages {
-
- public static String PackageGenerator_taskName;
- public static String GenScope_taskName;
- public static String EntityGenerator_taskName;
-
- private static final String BUNDLE_NAME = "jpt_gen"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptGenMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptGenMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java
deleted file mode 100644
index 12631a5bf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This object is shared by the two gen tables that make up the relation.
- * Upon construction, 'mappedBy' will be 'null'. The first gen table to be
- * used to generate an entity will fill in 'mappedBy' with the appropriate
- * attribute (field/property) name.
- */
-class ManyToManyRelation {
- private final GenTable joinGenTable;
- private final ForeignKey owningForeignKey;
- private final GenTable owningGenTable;
- private final ForeignKey nonOwningForeignKey;
- private final GenTable nonOwningGenTable;
- private String mappedBy; // set while generating entities
-
-
- ManyToManyRelation(
- GenTable joinGenTable,
- ForeignKey owningForeignKey,
- GenTable owningGenTable,
- ForeignKey nonOwningForeignKey,
- GenTable nonOwningGenTable
- ) {
- super();
- this.joinGenTable = joinGenTable;
-
- this.owningForeignKey = owningForeignKey;
- this.owningGenTable = owningGenTable;
- owningGenTable.addOwnedManyToManyRelation(this);
-
- this.nonOwningForeignKey = nonOwningForeignKey;
- this.nonOwningGenTable = nonOwningGenTable;
- nonOwningGenTable.addNonOwnedManyToManyRelation(this);
- }
-
- GenTable getJoinGenTable() {
- return this.joinGenTable;
- }
-
- ForeignKey getOwningForeignKey() {
- return this.owningForeignKey;
- }
-
- GenTable getOwningGenTable() {
- return this.owningGenTable;
- }
-
- ForeignKey getNonOwningForeignKey() {
- return this.nonOwningForeignKey;
- }
-
- GenTable getNonOwningGenTable() {
- return this.nonOwningGenTable;
- }
-
- String getOwnedAttributeName() {
- return this.nonOwningGenTable.getCollectionAttributeName();
- }
-
- String getNonOwnedAttributeName() {
- return this.owningGenTable.getCollectionAttributeName();
- }
-
- /**
- * the scope clears the join table relation if there are any references
- * to the join table
- */
- void clear() {
- this.owningGenTable.removeOwnedManyToManyRelation(this);
- this.nonOwningGenTable.removeNonOwnedManyToManyRelation(this);
- }
-
- String getMappedBy() {
- return this.mappedBy;
- }
-
- void setMappedBy(String mappedBy) {
- this.mappedBy = mappedBy;
- }
-
- String getOwningEntityName() {
- return this.owningGenTable.getEntityName();
- }
-
- String getNonOwningEntityName() {
- return this.nonOwningGenTable.getEntityName();
- }
-
- boolean joinTableNameIsDefault() {
- return this.joinGenTable.joinTableNameIsDefault();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.joinGenTable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java
deleted file mode 100644
index b69e402a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This object is held by the "base" gen table and, indirectly via a
- * one-to-many relation, the "referenced" gen table.
- * The "mapped by" attribute (field/property) name is set while the
- * "base" table is calculating its attribute names.
- */
-class ManyToOneRelation {
- private final GenTable baseGenTable; // the "many" side (e.g. Detail)
- private final ForeignKey foreignKey;
- private final GenTable referencedGenTable; // the "one" side (e.g. Master)
- private String mappedBy; // set while generating entities; used by partner one-to-many relation
-
-
- ManyToOneRelation(
- GenTable baseGenTable,
- ForeignKey foreignKey,
- GenTable referencedGenTable
- ) {
- super();
- this.baseGenTable = baseGenTable;
- this.foreignKey = foreignKey;
- this.referencedGenTable = referencedGenTable;
- referencedGenTable.addOneToManyRelation(new OneToManyRelation(this));
- }
-
- GenTable getBaseGenTable() {
- return this.baseGenTable;
- }
-
- ForeignKey getForeignKey() {
- return this.foreignKey;
- }
-
- GenTable getReferencedGenTable() {
- return this.referencedGenTable;
- }
-
- String getAttributeName() {
- return this.foreignKey.getAttributeName();
- }
-
- String getMappedBy() {
- return this.mappedBy;
- }
-
- void setMappedBy(String mappedBy) {
- this.mappedBy = mappedBy;
- }
-
- String getBaseEntityName() {
- return this.baseGenTable.getEntityName();
- }
-
- String getReferencedEntityName() {
- return this.referencedGenTable.getEntityName();
- }
-
- String getBaseGenTableCollectionAttributeName() {
- return this.baseGenTable.getCollectionAttributeName();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.foreignKey);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java
deleted file mode 100644
index 8d832ccd1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This object is the inverse of the corresponding many-to-one relation.
- */
-class OneToManyRelation {
- private final ManyToOneRelation manyToOneRelation;
-
-
- OneToManyRelation(ManyToOneRelation manyToOneRelation) {
- super();
- this.manyToOneRelation = manyToOneRelation;
- }
-
- ManyToOneRelation getManyToOneRelation() {
- return this.manyToOneRelation;
- }
-
- String getAttributeName() {
- return this.manyToOneRelation.getBaseGenTableCollectionAttributeName();
- }
-
- String getMappedBy() {
- return this.manyToOneRelation.getMappedBy();
- }
-
- String getReferencedEntityName() {
- return this.manyToOneRelation.getBaseEntityName();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.manyToOneRelation);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
deleted file mode 100644
index d1f67fd8c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This generator will generate a package of entities for a set of tables.
- */
-public class PackageGenerator {
- private final Config config;
- private final EntityGenerator.Config entityConfig;
- private final GenScope scope;
-
-
- // ********** public API **********
-
- public static void generateEntities(
- Config config,
- EntityGenerator.Config entityConfig,
- IProgressMonitor progressMonitor
- ) {
- if ((config == null) || (entityConfig == null)) {
- throw new NullPointerException();
- }
- SubMonitor sm = SubMonitor.convert(progressMonitor, JptGenMessages.PackageGenerator_taskName, 100);
- new PackageGenerator(config, entityConfig, sm.newChild(10)).generateEntities(sm.newChild(90));
- }
-
-
- // ********** construction/initialization **********
-
- private PackageGenerator(
- Config config,
- EntityGenerator.Config entityConfig,
- IProgressMonitor progressMonitor
- ) {
- super();
- this.config = config;
- this.entityConfig = entityConfig;
- this.scope = new GenScope(entityConfig, progressMonitor);
- }
-
-
- // ********** generation **********
-
- private void generateEntities(IProgressMonitor progressMonitor) {
- SubMonitor sm = SubMonitor.convert(progressMonitor, this.scope.entityTablesSize());
- for (Iterator<GenTable> stream = this.scope.entityGenTables(); stream.hasNext(); ) {
- this.checkCanceled(sm);
- this.generateEntity(stream.next(), sm.newChild(1));
- }
- }
-
- private void generateEntity(GenTable genTable, IProgressMonitor progressMonitor) {
- EntityGenerator.generateEntity(
- this.entityConfig,
- this.config.getPackageFragment(),
- genTable,
- progressMonitor
- );
- }
-
- private void checkCanceled(IProgressMonitor progressMonitor) {
- if (progressMonitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.scope);
- }
-
-
- // ********** config **********
-
- public static class Config {
- private IPackageFragment packageFragment;
-
- public IPackageFragment getPackageFragment() {
- return this.packageFragment;
- }
-
- public void setPackageFragment(IPackageFragment packageFragment) {
- this.packageFragment = packageFragment;
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
deleted file mode 100644
index bb6561e95f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests.extension.resource</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 55044aaf02..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:26:32 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF
deleted file mode 100644
index 35447db004..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.core.tests.extension.resource;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.jpt.core,
- org.eclipse.jpt.ui,
- org.eclipse.wst.validation,
- org.eclipse.jpt.core,
- org.eclipse.jpt.gen,
- org.eclipse.jface,
- org.eclipse.jpt.db,
- org.eclipse.jdt.core,
- org.eclipse.emf.ecore,
- org.eclipse.jpt.utility,
- org.eclipse.core.resources,
- org.eclipse.ui.navigator;bundle-version="3.3.100",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.4.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.core.tests.extension.resource;x-friends:="org.eclipse.jpt.ui.tests,org.eclipse.jpt.core.tests"
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties
deleted file mode 100644
index f5e3f40ad8..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties
deleted file mode 100644
index 83f727f621..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence API Tools - ExtensionTestPlugin
-providerName = Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml
deleted file mode 100644
index e74df7f16b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.jpt.core.jpaPlatform">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- label="Test Jpa Platform"
- class="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform"
- default="true">
- </jpaPlatform>
-
- </extension>
-
- <extension
- point="org.eclipse.jpt.ui.jpaPlatform">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- class="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUi">
- </jpaPlatform>
-
- </extension>
-
-</plugin>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java
deleted file mode 100644
index 51075a6443..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ExtensionTestPlugin extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.core.tests.extension.resource";
-
- // The shared instance
- private static ExtensionTestPlugin plugin;
-
- /**
- * The constructor
- */
- public ExtensionTestPlugin() {
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ExtensionTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
deleted file mode 100644
index 5f777f3f54..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-
-public class JavaTestAttributeMapping extends AbstractJavaAttributeMapping
-{
- public static final String TEST_ATTRIBUTE_MAPPING_KEY = "testAttribute";
- public static final String TEST_ATTRIBUTE_ANNOTATION_NAME = "test.TestAttribute";
-
-
- public JavaTestAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java
deleted file mode 100644
index 6d8edbec26..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-public class JavaTestAttributeMappingProvider
- implements JavaAttributeMappingProvider
-{
- // singleton
- private static final JavaTestAttributeMappingProvider INSTANCE = new JavaTestAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaTestAttributeMappingProvider() {
- super();
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public JavaTestAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestAttributeMapping(parent);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
deleted file mode 100644
index 7a7d848fbd..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTypeMapping;
-
-public class JavaTestTypeMapping extends AbstractJavaTypeMapping
-{
- public static final String TEST_TYPE_MAPPING_KEY = "test";
- public static final String TEST_TYPE_ANNOTATION_NAME = "test.Test";
-
-
- public JavaTestTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return TEST_TYPE_ANNOTATION_NAME;
- }
-
- public String getKey() {
- return TEST_TYPE_MAPPING_KEY;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isMapped() {
- return true;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java
deleted file mode 100644
index 3bca82aa6d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-
-/**
- *
- */
-public class JavaTestTypeMappingProvider
- implements JavaTypeMappingProvider
-{
- // singleton
- private static final JavaTestTypeMappingProvider INSTANCE = new JavaTestTypeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaTestTypeMappingProvider() {
- super();
- }
-
- public String getKey() {
- return JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestTypeMapping.TEST_TYPE_ANNOTATION_NAME;
- }
-
- public JavaTestTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestTypeMapping(parent);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java
deleted file mode 100644
index ccd2f6ae1d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaBasicMapping;
-
-public class TestJavaBasicMapping extends GenericJavaBasicMapping
-{
- public TestJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
deleted file mode 100644
index ecffe3a2b6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
-
-public class TestJavaEntity extends GenericJavaEntity
-{
- protected TestJavaEntity(JavaPersistentType parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java
deleted file mode 100644
index 203e751149..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.platform.GenericJpaFactory;
-
-public class TestJpaFactory extends GenericJpaFactory
-{
- @Override
- public JavaEntity buildJavaEntity(JavaPersistentType parent) {
- return new TestJavaEntity(parent);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new TestJavaBasicMapping(parent);
- }
-
- public JavaTestTypeMapping buildJavaTestTypeMapping(JavaPersistentType parent) {
- return new JavaTestTypeMapping(parent);
- }
-
- public JavaTestAttributeMapping buildJavaTestAttributeMapping(JavaPersistentAttribute parent) {
- return new JavaTestAttributeMapping(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java
deleted file mode 100644
index 40b1b77f49..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.List;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-
-public class TestJpaPlatform extends GenericJpaPlatform
-{
- public static final String ID = "core.testJpaPlatform";
-
- @Override
- public String getId() {
- return ID;
- }
-
- @Override
- protected JpaFactory buildJpaFactory() {
- return new TestJpaFactory();
- }
-
- @Override
- public JpaAnnotationProvider getAnnotationProvider() {
- return super.getAnnotationProvider();
- }
-
- @Override
- protected void addJavaTypeMappingProvidersTo(List<JavaTypeMappingProvider> providers) {
- super.addJavaTypeMappingProvidersTo(providers);
- providers.add(JavaTestTypeMappingProvider.instance());
- }
-
- @Override
- protected void addJavaAttributeMappingProvidersTo(List<JavaAttributeMappingProvider> providers) {
- super.addJavaAttributeMappingProvidersTo(providers);
- providers.add(JavaTestAttributeMappingProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java
deleted file mode 100644
index d508f79e23..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.List;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.ui.details.TypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.platform.generic.GenericNavigatorProvider;
-import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
-
-public class TestJpaPlatformUi extends BaseJpaPlatformUi
-{
- public TestJpaPlatformUi() {
- super();
- }
-
- public JpaNavigatorProvider buildNavigatorProvider() {
- return new GenericNavigatorProvider();
- }
-
- @Override
- protected JpaUiFactory createJpaUiFactory() {
- return new TestJpaUiFactory();
- }
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- protected void addJavaAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) {
- super.addJavaAttributeMappingUiProvidersTo(providers);
-
- }
-
- @Override
- protected void addJavaTypeMappingUiProvidersTo(List<TypeMappingUiProvider<? extends TypeMapping>> providers) {
- super.addJavaTypeMappingUiProvidersTo(providers);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java
deleted file mode 100644
index 29fa8b4b58..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.ui.internal.BaseJpaUiFactory;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see JpaUiFactory
- *
- * @version 1.0
- * @since 1.0
- */
-public class TestJpaUiFactory extends BaseJpaUiFactory
-{
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.classpath b/jpa/tests/org.eclipse.jpt.db.tests/.classpath
deleted file mode 100644
index ef8d91ca94..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.project b/jpa/tests/org.eclipse.jpt.db.tests/.project
deleted file mode 100644
index f5b0127a1e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index b23d0c7038..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:11 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 7ef2abe95e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.db.tests
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.junit;bundle-version="[3.8.2,4.0.0)",
- org.eclipse.datatools.connectivity;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,1.2.0)",
- org.eclipse.datatools.connectivity.sqm.core;bundle-version="1.0.1",
- org.eclipse.datatools.modelbase.sql;bundle-version="1.0.0",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)"
-Export-Package: org.eclipse.jpt.db.tests.internal;x-internal:=true,
- org.eclipse.jpt.db.tests.internal.platforms;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/about.html b/jpa/tests/org.eclipse.jpt.db.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/build.properties b/jpa/tests/org.eclipse.jpt.db.tests/build.properties
deleted file mode 100644
index cd0d010fd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.properties
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/derby.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/derby.properties
deleted file mode 100644
index a02643af95..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/derby.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional for Derby
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/derby/lib/derby.jar
-jars = C:/derby/lib/derby.jar
-
-# the JDBC URL is required for Derby
-# url = jdbc:derby:C:/derby/data/testdb;create=true
-url = jdbc:derby:C:/derby/data/testdb;create=true
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/mysql.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/mysql.properties
deleted file mode 100644
index 378b02cd4d..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/mysql.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/mysql/mysql-connector-java-5.0.6-bin.jar
-jars = C:/mysql/mysql-connector-java-5.0.6-bin.jar
-
-# the JDBC URL is optional for MySQL
-# url = jdbc:mysql://localhost:3306
-
-# the database is optional
-# database = testdb
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties
deleted file mode 100644
index 9c66852cd3..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars = C:/oracle/jdbc/lib/ojdbc5.jar
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:testdb
-url = jdbc:oracle:thin:@localhost:1521:orcl
-
-# the database is optional
-database = orcl
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties
deleted file mode 100644
index 8f76631645..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc14.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:XE
-url =
-
-# the database is optional
-database = XE
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties
deleted file mode 100644
index 669d5d8775..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc14.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:testdb
-url =
-
-# the database is optional
-database = testdb
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/postgresql.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/postgresql.properties
deleted file mode 100644
index eed8b7398b..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/postgresql.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/postgresql/jdbc/postgresql-8.2-506.jdbc3.jar
-jars = C:/postgresql/jdbc/postgresql-8.2-506.jdbc3.jar
-
-# the JDBC URL is optional for PostgreSQL
-# url = jdbc:postgresql
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver.properties
deleted file mode 100644
index 0ec008a451..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/sqlserver/lib/sqljdbc.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:sqlserver://localhost:1433;databaseName=testdb
-url =
-
-# the database is optional
-database = testdb
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/sybase.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sybase.properties
deleted file mode 100644
index 908f5e730c..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/sybase.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/sybase/lib/jconn3.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:sybase:Tds:localhost:5000/testdb
-url =
-
-# the database is optional
-database = testdb
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties
deleted file mode 100644
index b04fe27976..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = JPA DB Tests
-providerName = Eclipse.org
-
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java
deleted file mode 100644
index f8c0ca49cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal;
-
-import org.eclipse.jpt.db.tests.internal.platforms.AllPlatformTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * JPT DB Tests
- */
-public class JptDbTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptDbTests.class.getPackage().getName());
-
- suite.addTest( AllPlatformTests.suite());
-
- return suite;
- }
-
- private JptDbTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java
deleted file mode 100644
index 11c2a7e84a..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JptDbTestsPlugin
- */
-public class JptDbTestsPlugin extends Plugin {
-
- // The shared instance
- private static JptDbTestsPlugin plugin;
-
- public static final String BUNDLE_ID = "org.eclipse.jpt.db.tests"; //$NON-NLS-1$
-
- /**
- * Returns the shared instance
- */
- public static JptDbTestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * The constructor
- */
- public JptDbTestsPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java
deleted file mode 100644
index 0b5de9abea..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * AllPlatformTests
- */
-public class AllPlatformTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(AllPlatformTests.class.getPackage().getName());
-
-// TODO - Uncomment the platform to test.
-// suite.addTestSuite(DerbyTests.class);
-// suite.addTestSuite(MySQLTests.class);
-// suite.addTestSuite(Oracle10gTests.class);
-// suite.addTestSuite(Oracle10gXETests.class);
-// suite.addTestSuite(Oracle9iTests.class);
-// suite.addTestSuite(PostgreSQLTests.class);
-// suite.addTestSuite(SQLServerTests.class);
-// suite.addTestSuite(SybaseTests.class);
-
- return suite;
- }
-
- private AllPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
deleted file mode 100644
index 9c345f1d3d..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,924 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IManagedConnection;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
-import org.eclipse.datatools.connectivity.drivers.IPropertySet;
-import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
-import org.eclipse.datatools.connectivity.drivers.XMLFileManager;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;
-import org.eclipse.datatools.connectivity.sqm.core.connection.ConnectionInfo;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ConnectionListener;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.ConnectionProfileListener;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseFinder;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.JptDbPlugin;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.db.Sequence;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.db.ForeignKey.ColumnPair;
-import org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ResultSetIterator;
-
-import junit.framework.TestCase;
-
-/**
- * Base class for testing DTP wrappers on various databases.
- */
-@SuppressWarnings("nls")
-public abstract class DTPPlatformTests extends TestCase {
-
- /**
- * The platform properties are loaded from a Java properties file in the
- * 'org.eclipse.jpt.db.tests/config' directory. Each database platform has
- * its own properties file (e.g. 'derby101.properties').
- */
- private Properties platformProperties;
-
- /**
- * This is the Dali connection profile wrapper.
- */
- protected ConnectionProfile connectionProfile;
-
-
- // ********** constants **********
-
- private static final String PLATFORM_CONFIG_DIRECTORY = "config";
-
- private static final String DB_USER_ID_PROPERTY = "userID";
- private static final String DB_USER_ID_DEFAULT = "user";
-
- private static final String DB_PASSWORD_PROPERTY = "password";
- private static final String DB_PASSWORD_DEFAULT = "";
-
- private static final String DB_DRIVER_JARS_PROPERTY = "jars";
- // required - no default
-
- private static final String DB_URL_PROPERTY = "url";
- // required - no default
-
- private static final String DB_DATABASE_PROPERTY = "database";
- private static final String DB_DATABASE_DEFAULT = "testdb";
-
-
-
- // ********** constructor **********
-
- protected DTPPlatformTests(String name) {
- super(name);
- }
-
-
- // ********** set-up/tear-down **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.platformProperties = this.loadPlatformProperties();
- this.buildDTPDriverDefinitionFile();
- this.buildDTPConnectionProfile();
- this.connectionProfile = this.getConnectionProfileFactory().buildConnectionProfile(this.getProfileName(), DatabaseFinder.Default.instance());
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.connectionProfile = null;
- this.platformProperties = null;
-
- super.tearDown();
- }
-
- // ***** platform properties file
- private Properties loadPlatformProperties() throws IOException {
- Properties p = new Properties();
- p.load(this.buildPlatformPropertiesFileURL().openStream());
- return p;
- }
-
- private URL buildPlatformPropertiesFileURL() {
- return Platform.getBundle(this.getTestPluginBundleID()).getEntry(this.getPlatformPropertiesFilePath());
- }
-
- private String getTestPluginBundleID() {
- return JptDbTestsPlugin.BUNDLE_ID;
- }
-
- private String getPlatformPropertiesFilePath() {
- return this.getPlatformPropertiesDirectoryName() + '/' + this.getPlatformPropertiesFileName();
- }
-
- private String getPlatformPropertiesDirectoryName() {
- return PLATFORM_CONFIG_DIRECTORY;
- }
-
- /**
- * Each database platform has a separate properties file in the 'config'
- * directory that must be customized by whomever is executing the tests.
- */
- protected abstract String getPlatformPropertiesFileName();
-
- // ***** driver definition file
- private void buildDTPDriverDefinitionFile() throws CoreException {
- XMLFileManager.setStorageLocation(this.getDTPDriverDefinitionLocation());
- XMLFileManager.setFileName(this.getDTPDriverFileName());
-
- IPropertySet[] sets = XMLFileManager.loadPropertySets();
- for (IPropertySet set : sets) {
- if (set.getID().equals(this.getDriverDefinitionID())) {
- return; // property sets live across tests
- }
- }
-
- XMLFileManager.saveNamedPropertySet(this.buildDTPDriverDefinitionPropertySets());
-
- // verify the file was created:
- File driverDefinitioneFile = this.getDTPDriverDefinitionLocation().append(this.getDTPDriverFileName()).toFile();
- assertTrue(driverDefinitioneFile.exists());
- }
-
- private IPath getDTPDriverDefinitionLocation() {
- return ConnectivityPlugin.getDefault().getStateLocation();
- }
-
- private String getDTPDriverFileName() {
- return IDriverMgmtConstants.DRIVER_FILE;
- }
-
- private IPropertySet[] buildDTPDriverDefinitionPropertySets() {
- IPropertySet[] propertySets = new IPropertySet[1];
- PropertySetImpl propertySet = new PropertySetImpl(this.getDriverName(), this.getDriverDefinitionID());
- propertySet.setProperties(this.getDriverDefinitionID(), this.buildDTPDriverDefinitionProperties());
- propertySets[0] = propertySet;
- return propertySets;
- }
-
- protected abstract String getDriverName();
-
- protected abstract String getDriverDefinitionID();
-
- private Properties buildDTPDriverDefinitionProperties() {
- Properties p = new Properties();
- p.setProperty(ConnectionProfile.DRIVER_DEFINITION_TYPE_PROP_ID, this.getDriverDefinitionType());
- p.setProperty(ConnectionProfile.DRIVER_JAR_LIST_PROP_ID, this.getJDBCDriverJarList());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.getDatabaseVendor());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.getDatabaseVersion());
- p.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.getDriverClass());
- p.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, this.getJDBCURL());
- p.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, this.getUserID());
- p.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, this.getPassword());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.getDatabaseName());
- return p;
- }
-
- protected abstract String getDriverDefinitionType();
-
- /**
- * The JAR list is workspace-specific and is set in the properties file.
- */
- private String getJDBCDriverJarList() {
- return this.getRequiredPlatformProperty(DB_DRIVER_JARS_PROPERTY);
- }
-
- protected abstract String getDatabaseVendor();
-
- protected abstract String getDatabaseVersion();
-
- protected abstract String getDriverClass();
-
- /**
- * The database URL is workspace-specific and is set in the properties file
- * for some databases.
- */
- private String getJDBCURL() {
- return this.platformProperties.getProperty(DB_URL_PROPERTY, this.getDefaultJDBCURL());
- }
-
- protected String getDefaultJDBCURL() {
- return "";
- }
-
- /**
- * The user ID is optional and can be set in the properties file.
- */
- protected String getUserID() {
- return this.platformProperties.getProperty(DB_USER_ID_PROPERTY, DB_USER_ID_DEFAULT);
- }
-
- /**
- * The password is optional and can be set in the properties file.
- */
- private String getPassword() {
- return this.platformProperties.getProperty(DB_PASSWORD_PROPERTY, DB_PASSWORD_DEFAULT);
- }
-
- /**
- * The database name is optional and can be set in the properties file.
- */
- protected String getDatabaseName() {
- return this.platformProperties.getProperty(DB_DATABASE_PROPERTY, DB_DATABASE_DEFAULT);
- }
-
- // ***** DTP connection profile
- private void buildDTPConnectionProfile() throws ConnectionProfileException {
- if (this.getDTPProfileManager().getProfileByName(this.getProfileName()) != null) {
- return; // profiles live across tests
- }
- this.createProfile(this.getProfileName());
- assertNotNull(this.getDTPProfileManager().getProfileByName(this.getProfileName()));
- }
-
- protected void createProfile(String profileName) throws ConnectionProfileException {
- this.getDTPProfileManager().createProfile(
- profileName,
- this.getProfileDescription(),
- this.getProviderID(),
- this.buildDTPConnectionProfileProperties()
- );
- }
-
- protected abstract String getProfileName();
-
- protected abstract String getProfileDescription();
-
- protected String getProviderID() {
- return ConnectionProfile.CONNECTION_PROFILE_TYPE;
- }
-
- private Properties buildDTPConnectionProfileProperties() {
- Properties p = new Properties();
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.getDatabaseName());
- p.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, this.getUserID());
- p.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, this.getPassword());
- p.setProperty(ConnectionProfile.DRIVER_DEFINITION_PROP_ID, this.getDriverDefinitionID());
-
- p.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.getDriverClass());
- p.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, this.getJDBCURL());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.getDatabaseVendor());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.getDatabaseVersion());
-
- p.setProperty(ConnectionProfile.DATABASE_SAVE_PWD_PROP_ID, this.passwordIsSaved());
- return p;
- }
-
- private String passwordIsSaved() {
- return "true";
- }
-
-
- // ********** tests **********
-
- public void testConnectionProfileListener() throws ConnectionProfileException {
- TestConnectionProfileListener listener = new TestConnectionProfileListener();
- this.getConnectionProfileFactory().addConnectionProfileListener(listener);
-
- String cpName1 = this.getProfileName() + "1";
- this.createProfile(cpName1);
- IConnectionProfile dtpCP = this.getDTPProfileManager().getProfileByName(cpName1);
- assertNotNull(dtpCP);
-
- assertEquals(cpName1, listener.addedName);
- listener.clear();
-
- String cpName2 = this.getProfileName() + "2";
- this.getDTPProfileManager().modifyProfile(dtpCP, cpName2, null);
- assertEquals(cpName1, listener.renamedOldName);
- assertEquals(cpName2, listener.renamedNewName);
- listener.clear();
-
- ConnectionProfile cp = this.getConnectionProfileFactory().buildConnectionProfile(cpName2);
- assertNotNull(cp);
-
- this.getDTPProfileManager().deleteProfile(dtpCP);
- assertEquals(cpName2, listener.removedName);
- listener.clear();
-
- cp = this.getConnectionProfileFactory().buildConnectionProfile(cpName2);
- assertNull(cp);
-
- this.getConnectionProfileFactory().removeConnectionProfileListener(listener);
- }
-
- public void testName() {
- assertEquals(this.getProfileName(), this.connectionProfile.getName());
- }
-
- public void testConnection() throws Exception {
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- this.connectionProfile.connect();
- assertTrue(this.connectionProfile.isActive());
- assertTrue(this.connectionProfile.isConnected());
-
- this.verifyDatabaseVersionNumber();
- this.verifyDatabaseVendor();
- this.verifyDatabaseContent();
-
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- }
-
- private void verifyDatabaseVersionNumber() {
- Database database = this.connectionProfile.getDatabase();
- assertNotNull(database);
-
- String actual = database.getVersion();
- String expected = this.getDatabaseVersion();
- String errorMessage = "expected: " + expected + " - actual: " + actual;
- // partial match is good enough
- assertTrue(errorMessage, actual.indexOf(expected) != -1);
- }
-
- private void verifyDatabaseVendor() {
- Database database = this.connectionProfile.getDatabase();
- String actual = database.getVendorName();
- String expected = this.getDatabaseVendor();
- assertEquals(expected, actual);
- }
-
- private void verifyDatabaseContent() {
- Database database = this.connectionProfile.getDatabase();
- assertTrue(database.schemataSize() >= 0);
-
- Schema schema = database.getDefaultSchema();
- if (schema != null) {
- if (schema.tablesSize() > 0) {
- Table table = schema.tables().next();
- assertTrue(table.columnsSize() >= 0);
- assertTrue(table.primaryKeyColumnsSize() >= 0);
- assertTrue(table.foreignKeysSize() >= 0);
- }
- }
- }
-
- public void testOffline() {
- if ( ! this.connectionProfile.supportsWorkOfflineMode()) {
- return;
- }
-
- this.prepareForOfflineWork();
-
- IStatus status = this.connectionProfile.workOffline();
- assertTrue(status.isOK());
- assertTrue(this.connectionProfile.isActive());
- assertTrue(this.connectionProfile.isWorkingOffline());
-
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- }
-
- protected void prepareForOfflineWork() {
- if ( ! this.connectionProfile.canWorkOffline()) {
- this.connectionProfile.connect();
- IStatus status = this.connectionProfile.saveWorkOfflineData();
- assertTrue(status.isOK());
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.canWorkOffline());
- }
- }
-
- public void testConnectionListenerConnect() {
- assertTrue(this.connectionProfileHasNoListeners());
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
- assertTrue(this.connectionProfileHasAnyListeners());
-
- this.connectionProfile.connect();
- assertSame(this.connectionProfile, listener.openedProfile);
- listener.clear();
-
- this.connectionProfile.disconnect();
- assertSame(this.connectionProfile, listener.okToCloseProfile);
- assertSame(this.connectionProfile, listener.aboutToCloseProfile);
- assertSame(this.connectionProfile, listener.closedProfile);
-
- this.connectionProfile.removeConnectionListener(listener);
- assertTrue(this.connectionProfileHasNoListeners());
- }
-
- public void testConnectionListenerOffline() {
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.prepareForOfflineWork();
- listener.clear();
-
- this.connectionProfile.workOffline();
- assertSame(this.connectionProfile, listener.openedProfile);
- listener.clear();
-
- this.connectionProfile.disconnect();
- assertSame(this.connectionProfile, listener.okToCloseProfile);
- assertSame(this.connectionProfile, listener.aboutToCloseProfile);
- assertSame(this.connectionProfile, listener.closedProfile);
- listener.clear();
-
- this.connectionProfile.removeConnectionListener(listener);
- }
-
- public void testConnectionListenerDatabase() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.connectionProfile.getDatabase(), listener.changedDatabase);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testConnectionListenerCatalog() {
- this.connectionProfile.connect();
- if ( ! this.connectionProfile.getDatabase().supportsCatalogs()) {
- this.connectionProfile.disconnect();
- return;
- }
-
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // take the first catalog
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = this.getFirstDTPCatalog();
- Catalog catalog = this.getCatalogNamed(dtpCatalog.getName());
- ((ICatalogObject) dtpCatalog).refresh();
- assertSame(catalog, listener.changedCatalog);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testConnectionListenerSchema() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema = null;
- Schema schema = null;
- if (this.connectionProfile.getDatabase().supportsCatalogs()) {
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = this.getFirstDTPCatalog();
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) dtpCatalog.getSchemas().get(0);
- schema = this.getCatalogNamed(dtpCatalog.getName()).getSchemaNamed(dtpSchema.getName());
- } else {
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) this.getDTPDatabase().getSchemas().get(0);
- schema = this.connectionProfile.getDatabase().getSchemaNamed(dtpSchema.getName());
- }
- assertTrue(schema.tablesSize() >= 0); // force tables to be loaded
- ((ICatalogObject) dtpSchema).refresh();
- assertSame(schema, listener.changedSchema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSupportsCatalogs() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- assertEquals(this.supportsCatalogs(), this.connectionProfile.getDatabase().supportsCatalogs());
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected abstract boolean supportsCatalogs();
-
-
- // ********** convenience methods **********
-
- protected ConnectionProfileFactory getConnectionProfileFactory() {
- return JptDbPlugin.instance().getConnectionProfileFactory();
- }
-
- protected ConnectionProfile getConnectionProfile() {
- return this.connectionProfile;
- }
-
- protected Database getDatabase() {
- return this.connectionProfile.getDatabase();
- }
-
- protected Catalog getCatalogNamed(String catalogName) {
- return this.connectionProfile.getDatabase().getCatalogNamed(catalogName);
- }
-
- protected Schema getSchemaForIdentifier(String schemaName) {
- return this.connectionProfile.getDatabase().getSchemaForIdentifier(schemaName);
- }
-
- protected String getRequiredPlatformProperty(String propertyKey) {
- String propertyValue = this.platformProperties.getProperty(propertyKey);
- if (StringTools.stringIsEmpty(propertyValue)) {
- throw new IllegalArgumentException("The database platform properties file '" + this.getPlatformPropertiesFilePath()
- + "' is missing a value for the property '" + propertyKey + "'.");
- }
- return propertyValue;
- }
-
- protected boolean connectionProfileHasAnyListeners() {
- return connectionProfileHasAnyListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasAnyListeners(ConnectionProfile cp) {
- return ((Boolean) ClassTools.executeMethod(cp, "hasAnyListeners")).booleanValue();
- }
-
- protected boolean connectionProfileHasNoListeners() {
- return connectionProfileHasNoListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasNoListeners(ConnectionProfile cp) {
- return ((Boolean) ClassTools.executeMethod(cp, "hasNoListeners")).booleanValue();
- }
-
-
- // ********** DTP model **********
-
- protected ProfileManager getDTPProfileManager() {
- return ProfileManager.getInstance();
- }
-
- protected IConnectionProfile getDTPConnectionProfile() {
- return getDTPConnectionProfile(this.connectionProfile);
- }
-
- protected static IConnectionProfile getDTPConnectionProfile(ConnectionProfile cp) {
- return (IConnectionProfile) ClassTools.fieldValue(cp, "dtpConnectionProfile");
- }
-
- protected IManagedConnection getDTPManagedConnection() {
- return (IManagedConnection) ClassTools.fieldValue(this.connectionProfile, "dtpManagedConnection");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase() {
- return getDTPDatabase(this.connectionProfile.getDatabase());
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase(Database database) {
- return (org.eclipse.datatools.modelbase.sql.schema.Database) ClassTools.fieldValue(database, "dtpDatabase");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Catalog getFirstDTPCatalog() {
- return (org.eclipse.datatools.modelbase.sql.schema.Catalog) this.getDTPDatabase().getCatalogs().get(0);
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Catalog getDTPCatalogNamed(String name) {
- return getDTPCatalog(this.getDatabase().getCatalogNamed(name));
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Catalog getDTPCatalog(Catalog catalog) {
- return (org.eclipse.datatools.modelbase.sql.schema.Catalog) ClassTools.fieldValue(catalog, "dtpCatalog");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Schema getDTPSchemaNamed(String name) {
- return getDTPSchema(this.getDatabase().getSchemaNamed(name));
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Schema getDTPSchema(Schema schema) {
- return (org.eclipse.datatools.modelbase.sql.schema.Schema) ClassTools.fieldValue(schema, "dtpSchema");
- }
-
-
- // ********** execute SQL **********
-
- /**
- * ignore any errors (useful for dropping database objects that might
- * not be there)
- */
- protected void executeUpdateIgnoreErrors(String sql) {
- try {
- this.executeUpdate(sql);
- } catch (Exception ex) {
-// System.err.println("SQL: " + sql);
-// ex.printStackTrace();
- }
- }
-
- protected void executeUpdate(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- try {
- jdbcStatement.executeUpdate(sql);
- } finally {
- jdbcStatement.close();
- }
- }
-
- protected void dump(String sql) throws SQLException {
- for (Object[] row : this.execute(sql)) {
- for (int i = 0; i < row.length; i++) {
- if (i > 0) {
- System.out.print(' ');
- }
- System.out.print(StringTools.padOrTruncate(String.valueOf(row[i]), 20));
- }
- System.out.println();
- }
- }
-
- protected List<Object[]> execute(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- jdbcStatement.execute(sql);
- ResultSet resultSet = jdbcStatement.getResultSet();
- ResultSetMetaData metaData = resultSet.getMetaData();
- int columnCount = metaData.getColumnCount();
- ArrayList<Object[]> rows = new ArrayList<Object[]>();
- for (Iterator<Object[]> stream = new ResultSetIterator<Object[]>(resultSet, new LocalResultSetIteratorAdapter(columnCount)); stream.hasNext(); ) {
- rows.add(stream.next());
- }
- jdbcStatement.close();
- return rows;
- }
-
- public class LocalResultSetIteratorAdapter implements ResultSetIterator.Adapter<Object[]> {
- private int columnCount;
- public LocalResultSetIteratorAdapter(int columnCount) {
- super();
- this.columnCount = columnCount;
- }
- public Object[] buildNext(ResultSet rs) throws SQLException {
- Object[] row = new Object[this.columnCount];
- for (int i = 0; i < row.length; i++) {
- row[i] = rs.getObject(i + 1); // NB: ResultSet index/subscript is 1-based
- }
- return row;
- }
- }
-
- protected Statement createJDBCStatement() throws SQLException {
- return this.getJDBCConnection().createStatement();
- }
-
- protected Connection getJDBCConnection() {
- return ((ConnectionInfo) this.getDTPManagedConnection().getConnection().getRawConnection()).getSharedConnection();
- }
-
-
- // ********** dump database schema **********
-
- /**
- * dump all the database metadata to the console
- */
- protected void dumpDatabase() {
- this.dumpDatabase(true);
- }
-
- /**
- * dump the database catalogs and schemata to the console
- */
- protected void dumpDatabaseContainers() {
- this.dumpDatabase(false);
- }
-
- protected void dumpDatabase(boolean deep) {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpDatabaseOn(pw, deep);
- }
- pw.flush();
- }
-
- protected void dumpDatabaseOn(IndentingPrintWriter pw, boolean deep) {
- Database database = this.connectionProfile.getDatabase();
- pw.print("database: ");
- pw.println(database.getName());
- if (database.supportsCatalogs()) {
- for (Iterator<Catalog> stream = database.catalogs(); stream.hasNext(); ) {
- this.dumpCatalogOn(stream.next(), pw, deep);
- }
- } else {
- this.dumpSchemaContainerOn(database, pw, deep);
- }
- }
-
- protected void dumpCatalogOn(Catalog catalog, IndentingPrintWriter pw, boolean deep) {
- pw.print("catalog: ");
- pw.println(catalog.getName());
- pw.indent();
- this.dumpSchemaContainerOn(catalog, pw, deep);
- pw.undent();
- }
-
- protected void dumpSchemaContainerOn(SchemaContainer schemaContainer, IndentingPrintWriter pw, boolean deep) {
- for (Iterator<Schema> stream = schemaContainer.schemata(); stream.hasNext(); ) {
- this.dumpSchemaOn(stream.next(), pw, deep);
- }
- }
-
- protected void dumpSchema(Schema schema) {
- this.dumpSchema(schema, true);
- }
-
- protected void dumpSchema(Schema schema, boolean deep) {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpSchemaOn(schema, pw, deep);
- }
- pw.flush();
- }
-
- protected void dumpSchemaOn(Schema schema, IndentingPrintWriter pw, boolean deep) {
- pw.print("schema: ");
- pw.println(schema.getName());
- if (deep) {
- pw.indent();
- for (Iterator<Table> stream = schema.tables(); stream.hasNext(); ) {
- this.dumpTableOn(stream.next(), pw);
- }
- for (Iterator<Sequence> stream = schema.sequences(); stream.hasNext(); ) {
- this.dumpSequenceOn(stream.next(), pw);
- }
- pw.undent();
- }
- }
-
- protected void dumpTableOn(Table table, IndentingPrintWriter pw) {
- pw.print("table: ");
- pw.println(table.getName());
- pw.indent();
- for (Iterator<Column> stream = table.columns(); stream.hasNext(); ) {
- this.dumpColumnOn(stream.next(), pw);
- }
- for (Iterator<ForeignKey> stream = table.foreignKeys(); stream.hasNext(); ) {
- this.dumpForeignKeyOn(stream.next(), pw);
- }
- pw.undent();
- }
-
- protected void dumpColumnOn(Column column, IndentingPrintWriter pw) {
- pw.print("column: ");
- pw.print(column.getName());
- pw.print(" : ");
- pw.print(column.getDataTypeName());
- if (column.isPrimaryKeyColumn()) {
- pw.print(" [primary key]");
- }
- pw.println();
- }
-
- protected void dumpForeignKeyOn(ForeignKey foreignKey, IndentingPrintWriter pw) {
- pw.print("foreign key: ");
- pw.print(foreignKey.getName());
- pw.print("=>");
- pw.print(foreignKey.getReferencedTable().getName());
- pw.print(" (");
- for (Iterator<ColumnPair> stream = foreignKey.columnPairs(); stream.hasNext(); ) {
- ColumnPair cp = stream.next();
- pw.print(cp.getBaseColumn().getName());
- pw.print("=>");
- pw.print(cp.getReferencedColumn().getName());
- if (stream.hasNext()) {
- pw.print(", ");
- }
- }
- pw.print(')');
- pw.println();
- }
-
- protected void dumpSequenceOn(Sequence sequence, IndentingPrintWriter pw) {
- pw.print("sequence: ");
- pw.println(sequence.getName());
- }
-
-
- // ********** connection profile listener **********
-
- protected class TestConnectionProfileListener implements ConnectionProfileListener {
- public String addedName;
- public String removedName;
- public String renamedOldName;
- public String renamedNewName;
-
- public void connectionProfileAdded(String name) {
- this.addedName = name;
- }
- public void connectionProfileRemoved(String name) {
- this.removedName = name;
- }
- public void connectionProfileRenamed(String oldName, String newName) {
- this.renamedOldName = oldName;
- this.renamedNewName = newName;
- }
- public void clear() {
- this.addedName = null;
- this.removedName = null;
- this.renamedOldName = null;
- this.renamedNewName = null;
- }
- }
-
-
- // ********** connection listener **********
-
- protected class TestConnectionListener implements ConnectionListener {
- public ConnectionProfile openedProfile;
- public ConnectionProfile modifiedProfile;
- public ConnectionProfile okToCloseProfile;
- public ConnectionProfile aboutToCloseProfile;
- public ConnectionProfile closedProfile;
- public Database changedDatabase;
- public Catalog changedCatalog;
- public Schema changedSchema;
- public Sequence changedSequence;
- public Table changedTable;
- public Column changedColumn;
- public ForeignKey changedForeignKey;
-
- public void opened(ConnectionProfile profile) {
- this.openedProfile = profile;
- }
- public void modified(ConnectionProfile profile) {
- this.modifiedProfile = profile;
- }
- public boolean okToClose(ConnectionProfile profile) {
- this.okToCloseProfile = profile;
- return true;
- }
- public void aboutToClose(ConnectionProfile profile) {
- this.aboutToCloseProfile = profile;
- }
- public void closed(ConnectionProfile profile) {
- this.closedProfile = profile;
- }
- public void databaseChanged(ConnectionProfile profile, Database database) {
- this.changedDatabase = database;
- }
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- this.changedCatalog = catalog;
- }
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- this.changedSchema = schema;
- }
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- this.changedSequence = sequence;
- }
- public void tableChanged(ConnectionProfile profile, Table table) {
- this.changedTable = table;
- }
- public void columnChanged(ConnectionProfile profile, Column column) {
- this.changedColumn = column;
- }
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- this.changedForeignKey = foreignKey;
- }
- public void clear() {
- this.openedProfile = null;
- this.modifiedProfile = null;
- this.okToCloseProfile = null;
- this.aboutToCloseProfile = null;
- this.closedProfile = null;
- this.changedDatabase = null;
- this.changedCatalog = null;
- this.changedSchema = null;
- this.changedSequence = null;
- this.changedTable = null;
- this.changedColumn = null;
- this.changedForeignKey = null;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java
deleted file mode 100644
index 65cee80560..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-
-/**
- * Derby 10.1 Embedded Driver Test
- */
-@SuppressWarnings("nls")
-public class DerbyTests extends DTPPlatformTests {
-
- public DerbyTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "derby.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Derby";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10.1";
- }
-
- @Override
- protected String getDriverClass() {
- return "org.apache.derby.jdbc.EmbeddedDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Derby_10.1_Embedded";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Derby 10.1 Embedded JDBC Profile [Test]";
- }
-
- @Override
- protected String getProviderID() {
- return "org.eclipse.datatools.connectivity.db.derby.embedded.connectionProfile";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- public void testSchema() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("TEST1");
- this.dropSchema("TEST2");
-
- this.executeUpdate("CREATE SCHEMA TEST1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema1 = this.getDatabase().getSchemaNamed("TEST1");
- assertNotNull(schema1);
- Catalog catalog = this.getDatabase().getCatalogNamed(""); // Derby's only catalog
- Schema schema1a = catalog.getSchemaNamed("TEST1");
- assertNotNull(schema1a);
- assertSame(schema1, schema1a); // same schema should be returned by both database and catalog
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDatabase().getSchemaNamed("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) getDTPCatalog(catalog)).refresh();
- assertSame(catalog, listener.changedCatalog);
- assertSame(catalog, this.getDatabase().getCatalogNamed(""));
-
- schema2 = this.getDatabase().getSchemaNamed("TEST2");
- assertNotNull(schema2);
- Schema schema2a = catalog.getSchemaNamed("TEST2");
- assertNotNull(schema2a);
- assertSame(schema2, schema2a);
- assertNotSame(schema1, catalog.getSchemaNamed("TEST1")); // we should have a new schema after the refresh
-
- this.dropSchema("TEST2");
- this.dropSchema("TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dumpDatabaseContainers();
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- this.dumpDatabaseContainers();
-
- this.executeUpdate("CREATE SCHEMA LOOKUP_TEST");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- this.dumpDatabaseContainers();
-
- assertNotNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("LOOKUP_TEST");
-
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNotNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("\"lookup_TEST\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaIdentifier() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA lookup_test"); // this gets folded to uppercase
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST");
- assertEquals("LOOKUP_TEST", schema.getIdentifier());
- assertEquals("LOOKUP_TEST", schema.getIdentifier("LookupTest"));
- assertNull(schema.getIdentifier("Lookup_Test"));
-
- schema = this.getDatabase().getSchemaForIdentifier("lookup_test");
- assertEquals("LOOKUP_TEST", schema.getIdentifier());
-
- schema = this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\"");
- assertEquals("\"lookup_TEST\"", schema.getIdentifier());
- assertEquals("\"lookup_TEST\"", schema.getIdentifier("lookup_TEST"));
-
- this.dropSchema("\"lookup_TEST\"");
- this.dropSchema("LOOKUP_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET SCHEMA = TABLE_TEST");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaNamed("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableNamed("FOO");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("ID", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("ID");
- assertSame(pkColumn, idColumn);
- assertEquals("INTEGER", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPrimaryKeyColumn());
- assertFalse(idColumn.isForeignKeyColumn());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("NAME");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPrimaryKeyColumn());
-
- Column barColumn = fooTable.getColumnNamed("BAR_ID");
- assertEquals("INTEGER", barColumn.getDataTypeName());
- assertTrue(barColumn.isForeignKeyColumn());
- assertFalse(barColumn.isPrimaryKeyColumn());
-
- ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- assertEquals("BAR", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("BAR");
- assertEquals(2, barTable.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- assertEquals("ID", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnNamed("CHUNK").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("CHUNK").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("CHUNK").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("FOO_BAZ");
- assertEquals(2, foo_bazTable.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("FOO_ID").isForeignKeyColumn());
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAR (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" CHUNK BLOB(100K)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" NAME VARCHAR(20),").append(CR);
- sb.append(" BAR_ID INT REFERENCES BAR(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAZ (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" NAME VARCHAR(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO_BAZ (").append(CR);
- sb.append(" FOO_ID INT REFERENCES FOO(ID),").append(CR);
- sb.append(" BAZ_ID INT REFERENCES BAZ(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("COLUMN_TEST", "test");
- this.dropSchema("COLUMN_TEST");
-
- this.executeUpdate("CREATE SCHEMA COLUMN_TEST");
- this.executeUpdate("SET SCHEMA = COLUMN_TEST");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" INTEGER, \"Name\" VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("COLUMN_TEST", "test");
- this.dropSchema("COLUMN_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.getSchemaForIdentifier(schemaName);
- if (schema != null) {
- if (schema.getTableForIdentifier(tableName) != null) {
- this.executeUpdate("DROP TABLE " + schemaName + '.' + tableName);
- }
- }
- }
-
- /**
- * NB: A Derby schema must be empty before it can be dropped.
- */
- private void dropSchema(String name) throws Exception {
- if (this.getSchemaForIdentifier(name) != null) {
- this.executeUpdate("DROP SCHEMA " + name + " RESTRICT");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java
deleted file mode 100644
index 02742844c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-
-
-/**
- * SQL Server 2005 Driver Test
- *
- * Notes:
- * - We can only get database objects from the database associated with our
- * connection profile.
- * - We can reference objects across multiple databases, so they are sorta like
- * schemas....
- * - Foreign keys must be defined as table-level constraints; they cannot be
- * defined as part of the column clause.
- * - Case-sensitivity and -folding is whacked on MySQL....
- */
-@SuppressWarnings("nls")
-public class MySQLTests extends DTPPlatformTests {
-
- public MySQLTests( String name) {
- super(name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "mysql.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "MySQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.MySQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.mysql.4_1.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "MySql";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "4.1";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.mysql.jdbc.Driver";
- }
-
- @Override
- protected String getDefaultJDBCURL() {
- return "jdbc:mysql://localhost:3306";
- }
-
- @Override
- protected String getProfileName() {
- return "MySQL_4.1";
- }
-
- @Override
- protected String getProfileDescription() {
- return "MySQL 4.1 JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- public void testDatabase() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // MySQL has a single schema with the same name as the database
- Schema schema = this.getDatabase().getSchemaNamed(this.getDatabaseName());
- assertNotNull(schema);
- assertSame(this.getDatabase().getDefaultSchema(), schema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
-// this.dropDatabase("table_test");
-
-// this.executeUpdate("CREATE DATABASE table_test");
-
- // we must execute a USE statement before defining our tables
- this.executeUpdate("USE " + this.getDatabaseName());
-
- this.dropTable(this.getDatabaseName(), "foo_baz");
- this.dropTable(this.getDatabaseName(), "baz");
- this.dropTable(this.getDatabaseName(), "foo");
- this.dropTable(this.getDatabaseName(), "bar");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("id");
- assertSame(pkColumn, idColumn);
- assertEquals("INT", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPrimaryKeyColumn());
- assertFalse(idColumn.isForeignKeyColumn());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("name");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPrimaryKeyColumn());
-
- Column barColumn = fooTable.getColumnNamed("bar_id");
- assertEquals("INT", barColumn.getDataTypeName());
- assertTrue(barColumn.isForeignKeyColumn());
- assertFalse(barColumn.isPrimaryKeyColumn());
-
- ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("bar");
- assertEquals(2, barTable.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnNamed("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("chunk").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("foo_baz");
- assertEquals(2, foo_bazTable.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("foo_id").isForeignKeyColumn());
-
- this.dropTable(this.getDatabaseName(), "foo_baz");
- this.dropTable(this.getDatabaseName(), "baz");
- this.dropTable(this.getDatabaseName(), "foo");
- this.dropTable(this.getDatabaseName(), "bar");
-
-// this.dropDatabase("table_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE bar (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" chunk BLOB").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR(20),").append(CR);
- sb.append(" bar_id INTEGER,").append(CR);
- sb.append(" FOREIGN KEY (bar_id) REFERENCES bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE baz (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo_baz (").append(CR);
- sb.append(" foo_id INT,").append(CR);
- sb.append(" baz_id INT,").append(CR);
- sb.append(" FOREIGN KEY (foo_id) REFERENCES foo(id),").append(CR);
- sb.append(" FOREIGN KEY (baz_id) REFERENCES baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- /**
- * On Windows, table names get folded to lowercase by default;
- * even if the name is delimited (apparently).
- */
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // we must execute a USE statement before defining our tables
- this.executeUpdate("USE " + this.getDatabaseName());
-
- this.dropTable(this.getDatabaseName(), "test1");
- this.dropTable(this.getDatabaseName(), "TEST2");
- this.dropTable(this.getDatabaseName(), "`TEST3`");
-
- this.executeUpdate("CREATE TABLE test1 (id INTEGER, name VARCHAR(20))");
- this.executeUpdate("CREATE TABLE TEST2 (id INTEGER, name VARCHAR(20))");
- this.executeUpdate("CREATE TABLE `TEST3` (id INTEGER, name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
-
- // this probably only works on Windows
- Table test2Table = schema.getTableForIdentifier("test2");
- assertNotNull(test2Table);
-
- // this probably only works on Windows
- Table test3Table = schema.getTableForIdentifier("`test3`");
- assertNotNull(test3Table);
-
- this.dropTable(this.getDatabaseName(), "test1");
- this.dropTable(this.getDatabaseName(), "TEST2");
- this.dropTable(this.getDatabaseName(), "`TEST3`");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // we must execute a USE statement before defining our tables
- this.executeUpdate("USE " + this.getDatabaseName());
- this.dropTable(this.getDatabaseName(), "test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("ID"));
- assertNotNull(table.getColumnNamed("NAME"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("Id"));
- assertNotNull(table.getColumnNamed("Name"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (`Id` INTEGER, `Name` VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("`Id`"));
- assertNotNull(table.getColumnForIdentifier("`Name`"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String dbName, String tableName) throws Exception {
- this.executeUpdate("DROP TABLE IF EXISTS " + dbName + '.' + tableName);
- }
-
-// private void dropDatabase(String name) throws Exception {
-// this.executeUpdate("DROP DATABASE IF EXISTS " + name);
-// }
-//
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
deleted file mode 100644
index 7d6e498e6f..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import java.sql.SQLException;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-
-/**
- * Oracle 10g Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle10gTests extends DTPPlatformTests {
-
- public Oracle10gTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle10g.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle10g_10.1.0.4";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle10g (10.1.0.4) JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- public void testOffline() {
- // working offline is pretty ugly
- }
-
- @Override
- public void testConnectionListenerOffline() {
- // working offline is pretty ugly
- }
-
- public void testDatabase() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // Oracle should have a schema with the same name as the user
- Schema schema = this.getDatabase().getSchemaForIdentifier(this.getUserID());
- assertNotNull(schema);
- assertSame(this.getDatabase().getDefaultCatalog().getDefaultSchema(), schema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableForIdentifier("foo");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("ID", pkColumn.getName());
- Column idColumn = fooTable.getColumnForIdentifier("id");
- assertSame(pkColumn, idColumn);
- assertEquals("NUMBER", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPrimaryKeyColumn());
- assertFalse(idColumn.isForeignKeyColumn());
- assertEquals("java.math.BigDecimal", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnForIdentifier("name");
- assertEquals("VARCHAR2", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPrimaryKeyColumn());
-
- Column barColumn = fooTable.getColumnForIdentifier("bar_id");
- assertEquals("NUMBER", barColumn.getDataTypeName());
- assertTrue(barColumn.isForeignKeyColumn());
- assertFalse(barColumn.isPrimaryKeyColumn());
-
- ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- assertEquals("BAR", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableForIdentifier("bar");
- assertEquals(2, barTable.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- assertEquals("ID", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnForIdentifier("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnForIdentifier("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnForIdentifier("chunk").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableForIdentifier("foo_baz");
- assertEquals(2, foo_bazTable.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnForIdentifier("foo_id").isForeignKeyColumn());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE bar (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" chunk BLOB").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR2(20),").append(CR);
- sb.append(" bar_id REFERENCES bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE baz (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR2(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo_baz (").append(CR);
- sb.append(" foo_id NUMBER(10) REFERENCES foo(id),").append(CR);
- sb.append(" baz_id NUMBER(10) REFERENCES baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("\"test3\"");
-
- this.executeUpdate("CREATE TABLE test1 (id NUMBER(10), name VARCHAR2(20))");
- this.executeUpdate("CREATE TABLE TEST2 (id NUMBER(10), name VARCHAR2(20))");
- this.executeUpdate("CREATE TABLE \"test3\" (id NUMBER(10), name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
- test1Table = schema.getTableForIdentifier("TEST1");
- assertNotNull(test1Table);
-
- Table test2Table = schema.getTableForIdentifier("test2");
- assertNotNull(test2Table);
- test2Table = schema.getTableForIdentifier("TEST2");
- assertNotNull(test2Table);
-
- Table test3Table = schema.getTableForIdentifier("\"test3\"");
- assertNotNull(test3Table);
- test3Table = schema.getTableForIdentifier("test3");
- assertNull(test3Table);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("\"test3\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id NUMBER(10), name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID NUMBER(10), NAME VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id NUMBER(10), Name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" NUMBER(10), \"Name\" VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String tableName) throws Exception {
- this.executeUpdateIgnoreErrors("DROP TABLE " + tableName + " CASCADE CONSTRAINTS");
- }
-
-// need Oracle enablement plug-in
-// public void testSequence() throws Exception {
-// this.connectionProfile.connect();
-// TestConnectionListener listener = new TestConnectionListener();
-// this.connectionProfile.addConnectionListener(listener);
-//
-// this.dropSequence("FOO_SEQ");
-//
-// this.executeUpdate("CREATE SEQUENCE FOO_SEQ");
-// ((ICatalogObject) this.getDTPDatabase()).refresh();
-//
-// Sequence sequence = this.getDatabase().getDefaultSchema().getSequenceForIdentifier("FOO");
-// assertNotNull(sequence);
-// assertEquals("FOO_SEQ", sequence.getName());
-//
-// this.dropSequence("FOO_SEQ");
-//
-// this.connectionProfile.removeConnectionListener(listener);
-// this.connectionProfile.disconnect();
-// }
-//
-// private void dropSequence(String sequenceName) throws Exception {
-// this.executeUpdateIgnoreErrors("DROP SEQUENCE " + sequenceName);
-// }
-//
- protected void dumpUserObjects() throws SQLException {
- this.dump("select * from user_objects");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java
deleted file mode 100644
index aa2563af78..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle10gXETests extends DTPPlatformTests {
-
- public Oracle10gXETests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle10gXE.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle10g_XE";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle10g XE Release 2 (10.2) JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java
deleted file mode 100644
index 8e74a0272f..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 9i Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle9iTests extends DTPPlatformTests {
-
- public Oracle9iTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle9i.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 9i Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.9.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "9";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle9i";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle9i JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java
deleted file mode 100644
index b7492fad1e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class PostgreSQLTests extends DTPPlatformTests {
-
- public PostgreSQLTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "postgresql.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.postgresql.postgresqlDriverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "postgres";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "8.x";
- }
-
- @Override
- protected String getDriverClass() {
- return "org.postgresql.Driver";
- }
-
- @Override
- protected String getDefaultJDBCURL() {
- return "jdbc:postgresql";
- }
-
- @Override
- protected String getProfileName() {
- return "PostgreSQL";
- }
-
- @Override
- protected String getProfileDescription() {
- return "PostgreSQL 8.2 JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- public void testOffline() {
- // DTP does not support PostgreSQL off-line - see 226704/241558
- }
-
- @Override
- public void testConnectionListenerOffline() {
- // DTP does not support PostgreSQL off-line - see 226704/241558
- }
-
- public void testSchema() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("TEST1");
- this.dropSchema("TEST2");
-
- this.executeUpdate("CREATE SCHEMA TEST1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema1 = this.getDatabase().getSchemaForIdentifier("TEST1");
- assertNotNull(schema1);
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDatabase().getSchemaForIdentifier("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- schema2 = this.getDatabase().getSchemaForIdentifier("TEST2");
- assertNotNull(schema2);
- assertNotSame(schema1, this.getDatabase().getSchemaForIdentifier("TEST1")); // we should have a new schema after the refresh
-
- this.dropSchema("TEST2");
- this.dropSchema("TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA LOOKUP_TEST");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNotNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"lookup_test\""));
- assertNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
- assertNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
-
- this.dropSchema("LOOKUP_TEST");
-
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNotNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("\"lookup_TEST\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaIdentifier() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA lookup_test"); // this gets folded to lowercase
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST");
- assertEquals("lookup_test", schema.getIdentifier());
- assertEquals("lookup_test", schema.getIdentifier("LookupTest"));
- assertNull(schema.getIdentifier("Lookup_Test"));
-
- schema = this.getDatabase().getSchemaNamed("lookup_test");
- assertEquals("lookup_test", schema.getIdentifier());
-
- schema = this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\"");
- assertEquals("\"lookup_TEST\"", schema.getIdentifier());
- assertEquals("\"lookup_TEST\"", schema.getIdentifier("lookup_TEST"));
-
- this.dropSchema("\"lookup_TEST\"");
- this.dropSchema("LOOKUP_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET search_path TO TABLE_TEST");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaForIdentifier("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableForIdentifier("FOO");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnForIdentifier("ID");
- assertSame(pkColumn, idColumn);
- assertEquals("INT4", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPrimaryKeyColumn());
- assertFalse(idColumn.isForeignKeyColumn());
- assertEquals("java.lang.Integer", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnForIdentifier("NAME");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPrimaryKeyColumn());
-
- Column barColumn = fooTable.getColumnForIdentifier("BAR_ID");
- assertEquals("INT4", barColumn.getDataTypeName());
- assertTrue(barColumn.isForeignKeyColumn());
- assertFalse(barColumn.isPrimaryKeyColumn());
-
- ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableForIdentifier("BAR");
- assertEquals(2, barTable.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BYTEA", barTable.getColumnForIdentifier("CHUNK").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnForIdentifier("CHUNK").getJavaTypeDeclaration());
- // assertTrue(barTable.getColumnForIdentifier("CHUNK").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableForIdentifier("FOO_BAZ");
- assertEquals(2, foo_bazTable.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnForIdentifier("FOO_ID").isForeignKeyColumn());
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAR (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" CHUNK bytea").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" NAME varchar(20),").append(CR);
- sb.append(" BAR_ID integer REFERENCES BAR(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAZ (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" NAME varchar(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO_BAZ (").append(CR);
- sb.append(" FOO_ID int REFERENCES FOO(ID),").append(CR);
- sb.append(" BAZ_ID int REFERENCES BAZ(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "test");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET search_path TO TABLE_TEST");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id int, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID int, NAME varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id int, Name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" int, \"Name\" varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("TABLE_TEST", "test");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.getSchemaForIdentifier(schemaName);
- if (schema != null) {
- if (schema.getTableForIdentifier(tableName) != null) {
- this.executeUpdate("DROP TABLE " + schemaName + '.' + tableName);
- }
- }
- }
-
- private void dropSchema(String name) throws Exception {
- if (this.getSchemaForIdentifier(name) != null) {
- this.executeUpdate("DROP SCHEMA " + name + " CASCADE");
- }
- }
-
-// see 241578/241557
-// public void testSequence() throws Exception {
-// this.connectionProfile.connect();
-// TestConnectionListener listener = new TestConnectionListener();
-// this.connectionProfile.addConnectionListener(listener);
-//
-// this.dropSequence("SEQUENCE_TEST", "FOO");
-// this.dropSchema("SEQUENCE_TEST");
-//
-// this.executeUpdate("CREATE SCHEMA SEQUENCE_TEST");
-// this.executeUpdate("SET search_path TO SEQUENCE_TEST");
-//
-// this.executeUpdate(this.buildBarDDL());
-// this.executeUpdate("CREATE SEQUENCE FOO START 1");
-//// List<Object[]> list = this.execute("SELECT nextval('foo')");
-//// System.out.println(list);
-// ((ICatalogObject) this.getDTPDatabase()).refresh();
-//
-// Schema schema = this.getDatabase().getSchemaNamed("SEQUENCE_TEST");
-// Sequence sequence = schema.getSequenceNamed("FOO");
-// assertNotNull(sequence);
-// assertEquals("foo_seq", sequence.getName());
-//
-// this.dropSequence("SEQUENCE_TEST", "FOO");
-// this.dropSchema("SEQUENCE_TEST");
-//
-// this.connectionProfile.removeConnectionListener(listener);
-// this.connectionProfile.disconnect();
-// }
-//
-// private void dropSequence(String schemaName, String sequenceName) throws Exception {
-// Schema schema= this.getSchemaNamed(schemaName);
-// if (schema != null) {
-// if (schema.getSequenceNamed(sequenceName) != null) {
-// this.executeUpdate("DROP SEQUENCE " + schemaName + '.' + sequenceName);
-// }
-// }
-// }
-//
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java
deleted file mode 100644
index 98fa75a0b4..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * SQL Server 2005 Driver Test
- */
-@SuppressWarnings("nls")
-public class SQLServerTests extends DTPPlatformTests {
-
- public SQLServerTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "sqlserver.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "SQLServer";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "2005";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "SQLServer_2005";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Microsoft SQL Server 2005 JDBC Profile [Test]";
- }
-
- @Override
- protected String getProviderID() {
- return "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java
deleted file mode 100644
index 4257dd129a..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class SybaseTests extends DTPPlatformTests {
-
- public SybaseTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "sybase.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Sybase JDBC Driver for Sybase ASE 15.x";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Sybase JDBC Driver for Sybase ASE 15.x";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.sybase.ase.genericDriverTemplate_15";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Sybase_ASE";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "15.x";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.sybase.jdbc3.jdbc.SybDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Sybase_15";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Sybase ASE 15 jConnect JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- public void testOffline() {
- // working offline is pretty ugly
- }
-
- @Override
- public void testConnectionListenerOffline() {
- // working offline is pretty ugly
- }
-
- /**
- * Sybase "databases" become DTP "catalogs"
- */
- public void testCatalog() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.executeUpdate("use master");
- this.executeUpdateIgnoreErrors("drop database test1");
- this.executeUpdateIgnoreErrors("drop database test2");
-
- this.executeUpdate("create database test1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Catalog catalog1 = this.getDatabase().getCatalogNamed("test1");
- assertNotNull(catalog1);
- Schema schema1 = catalog1.getSchemaNamed("dbo");
- assertNotNull(schema1);
- assertSame(schema1, catalog1.getDefaultSchema());
-
- this.executeUpdate("create database test2");
- Catalog catalog2 = this.getDatabase().getCatalogNamed("test2");
- assertNull(catalog2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- catalog2 = this.getDatabase().getCatalogNamed("test2");
- assertNotNull(catalog2);
- Schema schema2 = catalog2.getDefaultSchema();
- assertNotNull(schema2);
- assertNotSame(catalog1, this.getDatabase().getSchemaNamed("test1")); // we should have a new schema after the refresh
-
- this.executeUpdate("drop database test2");
- this.executeUpdate("drop database test1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.executeUpdate("use master");
- this.executeUpdateIgnoreErrors("drop database table_test");
- this.executeUpdate("create database table_test");
- this.executeUpdate("use table_test");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getCatalogNamed("table_test").getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.columnsSize());
- assertEquals(1, fooTable.primaryKeyColumnsSize());
- assertEquals(1, fooTable.foreignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("id");
- assertSame(pkColumn, idColumn);
- assertEquals("INT", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPrimaryKeyColumn());
- assertFalse(idColumn.isForeignKeyColumn());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("name");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPrimaryKeyColumn());
-
- Column barColumn = fooTable.getColumnNamed("bar_id");
- assertEquals("INT", barColumn.getDataTypeName());
- assertTrue(barColumn.isForeignKeyColumn());
- assertFalse(barColumn.isPrimaryKeyColumn());
-
- ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.columnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("bar");
- assertEquals(2, barTable.columnsSize());
- assertEquals(1, barTable.primaryKeyColumnsSize());
- assertEquals(0, barTable.foreignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("IMAGE", barTable.getColumnNamed("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("chunk").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("foo_baz");
- assertEquals(2, foo_bazTable.columnsSize());
- assertEquals(0, foo_bazTable.primaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.foreignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("foo_id").isForeignKeyColumn());
-
- this.executeUpdate("drop table foo_baz");
- this.executeUpdate("drop table baz");
- this.executeUpdate("drop table foo");
- this.executeUpdate("drop table bar");
-
- this.executeUpdate("use master");
- this.executeUpdate("drop database table_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table bar (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" chunk image").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table foo (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" name varchar(20),").append(CR);
- sb.append(" bar_id integer references bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table baz (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" name varchar(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table foo_baz (").append(CR);
- sb.append(" foo_id integer references foo(id),").append(CR);
- sb.append(" baz_id integer references baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.executeUpdate("use master");
- this.executeUpdateIgnoreErrors("drop database table_lookup_test");
- this.executeUpdate("create database table_lookup_test");
- this.executeUpdate("use table_lookup_test");
-
- this.executeUpdate("create table test1 (id integer, name varchar(20))");
- this.executeUpdate("create table TEST2 (id integer, name varchar(20))");
- this.executeUpdate("create table [Test3] (id integer, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getCatalogNamed("table_lookup_test").getDefaultSchema();
-
- assertNotNull(schema.getTableNamed("test1"));
- assertNotNull(schema.getTableForIdentifier("test1"));
-
- assertNotNull(schema.getTableNamed("TEST2"));
- assertNotNull(schema.getTableForIdentifier("TEST2"));
-
- assertNotNull(schema.getTableForIdentifier("[Test3]"));
-
- this.executeUpdate("drop table [Test3]");
- this.executeUpdate("drop table TEST2");
- this.executeUpdate("drop table test1");
-
- this.executeUpdate("use master");
- this.executeUpdate("drop database table_lookup_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.executeUpdate("use master");
- this.executeUpdateIgnoreErrors("drop database column_lookup_test");
- this.executeUpdate("create database column_lookup_test");
- this.executeUpdate("use column_lookup_test");
-
- // lowercase
- this.executeUpdate("create table test (id integer, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
-
- this.executeUpdate("drop table test");
-
- // uppercase
- this.executeUpdate("create table test (ID integer, NAME varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.executeUpdate("drop table test");
-
- // mixed case
- this.executeUpdate("create table test (Id integer, Name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.executeUpdate("drop table test");
-
- // delimited
- this.executeUpdate("create table test ([Id] integer, [Name] varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("[Id]"));
- assertNotNull(table.getColumnForIdentifier("[Name]"));
-
- this.executeUpdate("drop table test");
-
- this.executeUpdate("use master");
- this.executeUpdate("drop database column_lookup_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/.classpath b/jpa/tests/org.eclipse.jpt.gen.tests/.classpath
deleted file mode 100644
index 84744e7e8a..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/gen/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/.project b/jpa/tests/org.eclipse.jpt.gen.tests/.project
deleted file mode 100644
index 2159feb5ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8bab913c29..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Mon Jul 07 20:13:24 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index b9425307fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.gen.tests
-Bundle-Version: 2.0.0
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.0",
- org.eclipse.jdt.core;bundle-version="3.4.0",
- org.eclipse.jpt.utility;bundle-version="1.2.0",
- org.eclipse.jpt.db;bundle-version="1.1.1",
- org.eclipse.jpt.gen;bundle-version="1.1.0",
- org.junit;bundle-version="3.8.2"
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/about.html b/jpa/tests/org.eclipse.jpt.gen.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/build.properties b/jpa/tests/org.eclipse.jpt.gen.tests/build.properties
deleted file mode 100644
index e68d4bf9e4..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-javacSource = 1.5
-javacTarget = 1.5
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties
deleted file mode 100644
index 269a5dc154..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved. This
-# program and the accompanying materials are made available under the terms of
-# the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors: Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Java Persistence Tools Entity Generation Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java b/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java
deleted file mode 100644
index 9ff221c28f..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.tests.internal;
-
-import java.util.HashSet;
-
-import org.eclipse.jpt.gen.internal.EntityGenTools;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-@SuppressWarnings("nls")
-public class EntityGenToolsTests extends TestCase {
-
- public EntityGenToolsTests(String name) {
- super(name);
- }
-
- public void testConvertToUniqueJavaStyleClassName1() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5oo", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName2() {
- HashSet<String> names = new HashSet<String>();
- names.add("Foo");
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName3() {
- HashSet<String> names = new HashSet<String>();
- names.add("foo");
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName4() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FooBar", names));
- assertEquals("Foo_bar", EntityGenTools.convertToUniqueJavaStyleClassName("foo_bar", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO_BAR", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_", names));
- assertEquals("FooBar_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleClassName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName5() {
- HashSet<String> names = new HashSet<String>();
- names.add("FooBar");
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FooBar", names));
- assertEquals("Foo_bar", EntityGenTools.convertToUniqueJavaStyleClassName("foo_bar", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO_BAR", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_", names));
- assertEquals("FooBar_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleClassName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName1() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5oo", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName2() {
- HashSet<String> names = new HashSet<String>();
- names.add("Foo");
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName3() {
- HashSet<String> names = new HashSet<String>();
- names.add("foo");
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName4() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FooBar", names));
- assertEquals("foo_bar", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo_bar", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO_BAR", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_", names));
- assertEquals("fooBar_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName5() {
- HashSet<String> names = new HashSet<String>();
- names.add("FooBar");
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FooBar", names));
- assertEquals("foo_bar", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo_bar", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO_BAR", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_", names));
- assertEquals("fooBar_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("4FOO_BAR", names));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java b/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java
deleted file mode 100644
index 1e79d7d032..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.gen.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.gen.tests.internal.EntityGenToolsTests;
-
-/**
- *
- */
-public class JptGenTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("JPT Entity Generation Tests"); //$NON-NLS-1$
- suite.addTestSuite(EntityGenToolsTests.class);
- return suite;
- }
-
- private JptGenTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/test.xml b/jpa/tests/org.eclipse.jpt.gen.tests/test.xml
deleted file mode 100644
index 11d311ae85..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/test.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.gen.tests"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="gen-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.gen.tests.internal.JptGenTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value=""/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.classpath b/jpa/tests/org.eclipse.jpt.ui.tests/.classpath
deleted file mode 100644
index 370877baf6..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.project b/jpa/tests/org.eclipse.jpt.ui.tests/.project
deleted file mode 100644
index 0240774761..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index d364a0f24e..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:27:16 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 6a66ed67ae..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.ui.tests
-Bundle-Version: 1.0.0
-Require-Bundle:
- org.junit4;bundle-version="4.3.1",
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jface,
- org.eclipse.jpt.core.tests,
- org.eclipse.jpt.core.tests.extension.resource,
- org.eclipse.jpt.utility,
- org.eclipse.jpt.core,
- org.eclipse.jpt.ui,
- org.eclipse.ui.workbench;bundle-version="3.4.0",
- org.eclipse.ui.forms;bundle-version="3.3.100"
-Export-Package: org.eclipse.jpt.ui.tests;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.jface;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.swt;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.util;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties b/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
deleted file mode 100644
index 34d2e4d2da..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
deleted file mode 100644
index ca8ab879ff..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved. This
-# program and the accompanying materials are made available under the terms of
-# the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors: Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Java Persistence API UI Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
deleted file mode 100644
index 310abb7607..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.ui.tests.internal.platform.JptUiPlatformTests;
-import org.eclipse.jpt.ui.tests.internal.swt.JptUiSWTTests;
-import org.eclipse.jpt.ui.tests.internal.util.JptUiUtilTests;
-
-/**
- * Runs all JPT UI Tests
- */
-public class JptUiTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiTests.class.getPackage().getName());
- suite.addTest(JptUiPlatformTests.suite());
- suite.addTest(JptUiSWTTests.suite());
- suite.addTest(JptUiUtilTests.suite());
- return suite;
- }
-
- private JptUiTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
deleted file mode 100644
index a5a7ec41da..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.jface;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class DelegatingLabelProviderUiTest extends ApplicationWindow
-{
- private TreeViewer tree;
-
- private WritablePropertyValueModel<Vehicle> selectedVehicle;
-
-
- public static void main(String[] args) {
- Window window = new DelegatingLabelProviderUiTest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
-
- private DelegatingLabelProviderUiTest(String[] args) {
- super(null);
- this.selectedVehicle = new SimplePropertyValueModel<Vehicle>();
- }
-
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 400);
- parent.setLayout(new GridLayout());
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
- mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
- return mainPanel;
- }
-
- private void buildTreePanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout());
-
- Label label = new Label(panel, SWT.NONE);
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- label.setText("My Vehicles");
-
- tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- DelegatingContentAndLabelProvider contentAndLabelProvider =
- new DelegatingTreeContentAndLabelProvider(
- new VehicleContentProviderFactory(),
- new VehicleLabelProviderFactory());
- tree.setContentProvider(contentAndLabelProvider);
- tree.setLabelProvider(contentAndLabelProvider);
- tree.setInput(new Root());
- tree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- }
-
- private ISelectionChangedListener buildTreeSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle.setValue((Vehicle) ((IStructuredSelection) event.getSelection()).getFirstElement());
- }
- };
- }
-
- private void buildControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout());
- buildUpperControlPanel(panel);
- buildLowerControlPanel(panel);
- }
-
- private void buildUpperControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout(2, true));
- buildVehicleCombo(panel);
- buildColorCombo(panel);
- }
-
- private void buildVehicleCombo(Composite parent) {
- final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
- combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- combo.setContentProvider(new ArrayContentProvider());
- combo.setLabelProvider(new VehicleTypeLabelProvider());
- combo.setInput(
- new VehicleType[] {
- VehicleType.BICYCLE, VehicleType.CAR,
- VehicleType.TRUCK, VehicleType.BOAT
- });
- combo.getCombo().setEnabled(false);
- combo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setVehicleType((VehicleType) ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.vehicleType()));
- }
- });
- }
-
- private void buildColorCombo(Composite parent) {
- final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
- combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- combo.setContentProvider(new ArrayContentProvider());
- combo.setLabelProvider(new ColorLabelProvider());
- combo.setInput(new Color[] {Color.RED, Color.BLUE, Color.YELLOW, Color.GREEN});
- combo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setColor((Color) ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.color()));
- }
- });
- }
-
- private void buildLowerControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout(3, false));
- buildEffectsLabel(panel);
- buildGreyedCheckBox(panel);
- buildTranslucentCheckBox(panel);
- buildActionPanel(panel);
- }
-
- private void buildEffectsLabel(Composite parent) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText("Color effects: ");
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
- }
-
- private void buildGreyedCheckBox(Composite parent) {
- final Button button = new Button(parent, SWT.CHECK);
- button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- button.setText("greyed");
- button.setEnabled(false);
- button.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setGreyed(button.getSelection());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isGreyed());
- }
- });
- }
-
- private void buildTranslucentCheckBox(Composite parent) {
- final Button button = new Button(parent, SWT.CHECK);
- button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
- button.setText("translucent");
- button.setEnabled(false);
- button.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setTranslucent(button.getSelection());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isTranslucent());
- }
- });
- }
-
- private void buildActionPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.END, GridData.FILL, false, false));
- panel.setLayout(new GridLayout());
- buildRefreshTreeACI().fill(panel);
- }
-
- private ActionContributionItem buildRefreshTreeACI() {
- Action action = new Action("Refresh tree", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- refreshTree();
- }
- };
- action.setToolTipText("Refresh the tree's labels");
- return new ActionContributionItem(action);
- }
-
- void refreshTree() {
- tree.refresh();
- }
-
- private Vehicle selectedVehicle() {
- return selectedVehicle.getValue();
- }
-
-
- private static class VehicleTypeLabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((VehicleType) element).description();
- }
- }
-
-
- private static class ColorLabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((Color) element).description();
- }
- }
-
-
- private static class VehicleContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Root) {
- return new RootContentProvider(
- (Root) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- return new VehicleContentProvider(
- (Vehicle) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- private static class RootContentProvider extends AbstractTreeItemContentProvider<Vehicle>
- {
- public RootContentProvider(Root item, DelegatingTreeContentAndLabelProvider contentAndLabelProvider) {
- super(item, contentAndLabelProvider);
- }
-
- @Override
- public Object getParent() {
- return null;
- }
-
- @Override
- protected ListValueModel<Vehicle> buildChildrenModel() {
- return new StaticListValueModel<Vehicle>(CollectionTools.list(((Root) model()).vehicles()));
- }
- }
-
- @SuppressWarnings("unchecked")
- private static class VehicleContentProvider extends AbstractTreeItemContentProvider
- {
- public VehicleContentProvider(Vehicle item, DelegatingTreeContentAndLabelProvider contentAndLabelProvider) {
- super(item, contentAndLabelProvider);
- }
-
- @Override
- public Object getParent() {
- return ((Vehicle) model()).parent();
- }
-
- @Override
- protected ListValueModel buildChildrenModel() {
- return new NullListValueModel();
- }
- }
-
-
- private static class VehicleLabelProviderFactory
- implements ItemLabelProviderFactory
- {
- public ItemLabelProvider buildItemLabelProvider(Object element, DelegatingContentAndLabelProvider labelProvider) {
- return new VehicleLabelProvider((Vehicle) element, labelProvider);
- }
- }
-
-
- private static class VehicleLabelProvider extends AbstractItemLabelProvider
- {
- public VehicleLabelProvider(Vehicle vehicle, DelegatingContentAndLabelProvider labelProvider) {
- super(vehicle, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<Vehicle, String>(
- new StaticPropertyValueModel<Vehicle>((Vehicle) model()),
- Vehicle.VEHICLE_TYPE_PROPERTY, Vehicle.COLOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.color().description() + ' ' + subject.vehicleType().description();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<Vehicle, Image>(
- new StaticPropertyValueModel<Vehicle>((Vehicle) model()),
- Vehicle.COLOR_PROPERTY, Vehicle.GREYED_PROPERTY, Vehicle.TRANSLUCENT_PROPERTY) {
- @Override
- protected Image buildValue_() {
- return subject.image();
- }
- };
- }
- }
-
-
- private static abstract class TreeNode extends AbstractModel
- {
- private TreeNode parent;
-
-
- public TreeNode(TreeNode parent) {
- this.parent = parent;
- }
-
-
- public TreeNode parent() {
- return parent;
- }
- }
-
-
- private static class Root extends TreeNode
- {
- protected final Vehicle[] vehicles;
-
-
- public Root() {
- super(null);
- vehicles = new Vehicle[] {
- new Vehicle(this, VehicleType.BICYCLE, Color.BLUE),
- new Vehicle(this, VehicleType.CAR, Color.YELLOW),
- new Vehicle(this, VehicleType.TRUCK, Color.RED),
- new Vehicle(this, VehicleType.BOAT, Color.GREEN)};
- }
-
- public Vehicle[] vehicles() {
- return vehicles;
- }
- }
-
-
- private static class Vehicle extends TreeNode
- {
- private VehicleType vehicleType;
- public final static String VEHICLE_TYPE_PROPERTY = "vehicleType";
-
- private Color color;
- public final static String COLOR_PROPERTY = "color";
-
- private boolean greyed = false;
- public final static String GREYED_PROPERTY = "greyed";
-
- private boolean translucent = false;
- public final static String TRANSLUCENT_PROPERTY = "translucent";
-
- private Image image;
-
-
- public Vehicle(TreeNode parent, VehicleType vehicleType, Color color) {
- super(parent);
- this.vehicleType = vehicleType;
- this.color = color;
- }
-
- public VehicleType vehicleType() {
- return vehicleType;
- }
-
- public void setVehicleType(VehicleType newVehicleType) {
- VehicleType oldVehicleType = vehicleType;
- vehicleType = newVehicleType;
- firePropertyChanged(VEHICLE_TYPE_PROPERTY, oldVehicleType, newVehicleType);
- }
-
- public Color color() {
- return color;
- }
-
- public void setColor(Color newColor) {
- Color oldColor = color;
- color = newColor;
- firePropertyChanged(COLOR_PROPERTY, oldColor, newColor);
- }
-
- public boolean isGreyed() {
- return greyed;
- }
-
- public void setGreyed(boolean newGreyed) {
- boolean oldGreyed = greyed;
- greyed = newGreyed;
- firePropertyChanged(GREYED_PROPERTY, oldGreyed, newGreyed);
- }
-
- public boolean isTranslucent() {
- return translucent;
- }
-
- public void setTranslucent(boolean newTranslucent) {
- boolean oldTranslucent = translucent;
- translucent = newTranslucent;
- firePropertyChanged(TRANSLUCENT_PROPERTY, oldTranslucent, newTranslucent);
- }
-
- public Image image() {
- if (image != null) {
- image.dispose();
- }
-
- return ImageFactory.image(color(), greyed, translucent);
- }
- }
-
-
- private static enum VehicleType
- {
- BICYCLE("bicycle"),
- CAR("car"),
- TRUCK("truck"),
- BOAT("boat");
-
- private final String description;
-
- private VehicleType(String description) {
- this.description = description;
- }
-
- public String description() {
- return description;
- }
-
- @Override
- public String toString() {
- return description();
- }
- }
-
-
- private static enum Color
- {
- RED("red", new RGB(255, 0, 0)),
- BLUE("blue", new RGB(0, 0, 255)),
- YELLOW("yellow", new RGB(255, 255, 0)),
- GREEN("green", new RGB(0, 255, 0));
-
- private final String description;
-
- private final RGB rgb;
-
- private Color(String description, RGB rgb) {
- this.description = description;
- this.rgb = rgb;
- }
-
- public String description() {
- return description;
- }
-
- public RGB rgb() {
- return rgb;
- }
-
- @Override
- public String toString() {
- return description();
- }
- }
-
-
- private static class ImageFactory
- {
- private static RGB rgb(Color color, boolean greyed, boolean translucent) {
- RGB rgb = (greyed) ? new RGB(127, 127, 127) : color.rgb();
- if (translucent) {
- rgb = new RGB(translucify(rgb.red), translucify(rgb.green), translucify(rgb.blue));
- }
- return rgb;
- }
-
- private static int translucify(int color) {
- return 255 - (int) ((255 - color) * 0.3);
- }
-
- public static Image image(Color color, boolean greyed, boolean translucent) {
- PaletteData pd = new PaletteData(new RGB[] {rgb(color, greyed, translucent)});
- ImageData id = new ImageData(20, 20, 1, pd);
- for (int x = 0; x < 20; x ++) {
- for (int y = 0; y < 20; y ++) {
- id.setPixel(x, y, 0);
- }
- }
- return new Image(Display.getCurrent(), id);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
deleted file mode 100644
index 87203da17d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.jface;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
-{
- private final Root root;
-
- private WritablePropertyValueModel<TreeNode> selectedNode;
-
- private TreeViewer controlTree;
-
- private TreeViewer viewTree;
-
- private Text nodeNameText;
-
-
- public static void main(String[] args) {
- Window window = new DelegatingTreeContentProviderUiTest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private DelegatingTreeContentProviderUiTest(String[] args) {
- super(null);
- this.root = new Root();
- this.root.addChild("Parent_1");
- this.selectedNode = new SimplePropertyValueModel<TreeNode>(this.root);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(800, 400);
- parent.setLayout(new GridLayout());
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
- mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
- return mainPanel;
- }
-
- private void buildTreePanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout(2, true));
- buildControlTreePanel(panel);
- buildViewTreePanel(panel);
- }
-
- private void buildControlTreePanel(Composite parent) {
- controlTree = buildTreePanel(
- parent, "Control tree",
- new DelegatingTreeContentAndLabelProvider(new ControlTreeItemContentProviderFactory()),
- new LabelProvider());
- controlTree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- controlTree.setSelection(new StructuredSelection(event.getNewValue()));
- }
- }
- );
- }
-
- private void buildViewTreePanel(Composite parent) {
- viewTree = buildTreePanel(
- parent, "View tree",
- new DelegatingTreeContentAndLabelProvider(new ViewTreeItemContentProviderFactory()),
- new LabelProvider());
- }
-
- private TreeViewer buildTreePanel(Composite parent, String labelText, ITreeContentProvider contentProvider, ILabelProvider labelProvider) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout());
-
- Label label = new Label(panel, SWT.LEFT);
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- label.setText(labelText);
-
- final TreeViewer tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- tree.setContentProvider(contentProvider);
- tree.setLabelProvider(labelProvider);
- tree.setInput(root);
-
- return tree;
- }
-
- private ISelectionChangedListener buildTreeSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- TreeNode selection = (TreeNode) ((IStructuredSelection) event.getSelection()).getFirstElement();
- selectedNode.setValue((selection == null) ? root : selection);
- }
- };
- }
-
- private void buildControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- panel.setLayout(new GridLayout(6, false));
- buildNodeNameText(panel);
- buildAddChildACI().fill(panel);
- buildAddNestedChildACI().fill(panel);
- buildRemoveACI().fill(panel);
- buildClearModelACI().fill(panel);
- buildRestoreModelACI().fill(panel);
- }
-
- private void buildNodeNameText(Composite parent) {
- nodeNameText = new Text(parent, SWT.SINGLE | SWT.BORDER);
- nodeNameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- }
-
- private ActionContributionItem buildAddChildACI() {
- final Action action = new Action("Add child", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- addChild();
- }
- };
- action.setToolTipText("Add a child with the given name");
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(((TreeNode) event.getNewValue()).canHaveChildren());
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildAddNestedChildACI() {
- final Action action = new Action("Add nested child", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- addNestedChild();
- }
- };
- action.setToolTipText("Add a nested child with the given name");
- action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(((TreeNode) event.getNewValue()).canHaveNestedChildren());
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRemoveACI() {
- final Action action = new Action("Remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- remove();
- }
- };
- action.setToolTipText("Remove the selected node");
- action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(event.getNewValue() != root);
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("Clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- clearModel();
- }
- };
- action.setToolTipText("Clear the model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("Restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- restoreModel();
- }
- };
- action.setToolTipText("Restore the model");
- return new ActionContributionItem(action);
- }
-
- void addChild() {
- String nodeName = nodeNameText.getText();
- if (nodeName.length() != 0) {
- selectedNode.getValue().addChild(nodeName);
- }
- }
-
- void addNestedChild() {
- String nodeName = nodeNameText.getText();
- if (nodeName.length() != 0) {
- selectedNode.getValue().addNestedChild(nodeName);
- }
- }
-
- void remove() {
- TreeNode node = selectedNode.getValue();
- node.parent().removeChild(node);
- }
-
- void clearModel() {
- controlTree.setInput(null);
- viewTree.setInput(null);
- }
-
- void restoreModel() {
- controlTree.setInput(root);
- viewTree.setInput(root);
- }
-
-
- private static abstract class AbstractTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- return new GenericTreeItemContentProvider(
- (TreeNode) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- private static class ControlTreeItemContentProviderFactory extends AbstractTreeItemContentProviderFactory
- {
-
- }
-
-
- private static class ViewTreeItemContentProviderFactory
- extends AbstractTreeItemContentProviderFactory
- {
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Parent) {
- return new ViewTreeParentItemContentProvider(
- (Parent) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- return super.buildItemContentProvider(item, contentAndLabelProvider);
- }
- }
-
-
- private static class GenericTreeItemContentProvider extends AbstractTreeItemContentProvider<TreeNode>
- {
- public GenericTreeItemContentProvider(
- TreeNode treeNode, DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider) {
- super(treeNode, treeContentAndLabelProvider);
- }
-
- protected TreeNode treeNode() {
- return (TreeNode) model();
- }
-
- @Override
- public TreeNode getParent() {
- return treeNode().parent();
- }
-
- @Override
- protected ListValueModel<TreeNode> buildChildrenModel() {
- return new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, treeNode()) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return treeNode().children();
- }
- };
- }
- }
-
- private static class ViewTreeParentItemContentProvider extends GenericTreeItemContentProvider
- {
- public ViewTreeParentItemContentProvider(
- TreeNode treeNode, DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider) {
- super(treeNode, treeContentAndLabelProvider);
- }
-
- @Override
- public TreeNode getParent() {
- TreeNode parent = super.getParent();
- if (parent instanceof Nest) {
- parent = parent.parent();
- }
- return parent;
- }
-
- @Override
- protected ListValueModel<TreeNode> buildChildrenModel() {
- return buildChildrenModel(
- new CompositeCollectionValueModel<TreeNode, TreeNode>(super.buildChildrenModel()) {
- @Override
- protected CollectionValueModel<TreeNode> transform(TreeNode value) {
- if (value instanceof Nest) {
- final Nest nest = (Nest) value;
- return new ListCollectionValueModelAdapter<TreeNode>(
- new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, nest) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return nest.children();
- }
- }
- );
- }
- else {
- return new StaticCollectionValueModel<TreeNode>(CollectionTools.collection(value));
- }
- }
- }
- );
- }
- }
-
-
- private static class LabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((TreeNode) element).getName();
- }
- }
-
-
- private static abstract class TreeNode extends AbstractModel
- {
- private TreeNode parent;
-
- protected final List<TreeNode> children;
- public final static String CHILDREN_LIST = "children";
-
- protected String name;
- public final static String NAME_PROPERTY = "name";
-
-
- public TreeNode(TreeNode parent, String name) {
- this.parent = parent;
- this.children = new ArrayList<TreeNode>();
- this.name = name;
- }
-
- public TreeNode parent() {
- return parent;
- }
-
- public ListIterator<TreeNode> children() {
- return new ReadOnlyListIterator<TreeNode>(children);
- }
-
- protected void addChild(TreeNode child) {
- addItemToList(child, children, CHILDREN_LIST);
- }
-
- public void removeChild(TreeNode child) {
- removeItemFromList(child, children, CHILDREN_LIST);
- }
-
- public void removeChild(int index) {
- removeItemFromList(index, children, CHILDREN_LIST);
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public boolean canHaveChildren() {
- return false;
- }
-
- public void addChild(String name) {
- throw new UnsupportedOperationException();
- }
-
- public boolean canHaveNestedChildren() {
- return false;
- }
-
- public void addNestedChild(String name) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getName());
- }
- }
-
-
- private static class Root extends TreeNode
- {
- public Root() {
- super(null, null);
- }
-
- @Override
- public boolean canHaveChildren() {
- return true;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Parent(this, name));
- }
- }
-
-
- private static class Parent extends TreeNode
- {
- public Parent(TreeNode parent, String name) {
- super(parent, name);
- }
-
- @Override
- public boolean canHaveChildren() {
- return true;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Child(this, name));
- }
-
- @Override
- public boolean canHaveNestedChildren() {
- return true;
- }
-
- @Override
- public void addNestedChild(String name) {
- TreeNode nest = new Nest(this);
- addChild(nest);
- nest.addChild(name);
- }
-
- public Iterator<Child> nestlessChildren() {
- return new FilteringIterator<Child, Child>(
- new TransformationIterator<TreeNode, Child>(children()) {
- @Override
- protected Child transform(TreeNode next) {
- if (next instanceof Nest) {
- return ((Nest) next).child();
- }
- return (Child) next;
- }
- }) {
- @Override
- protected boolean accept(Child c) {
- return c != null;
- }
- };
- }
- }
-
-
- private static class Nest extends TreeNode
- {
- public Nest(TreeNode parent) {
- super(parent, "nest");
- }
-
- @Override
- public boolean canHaveChildren() {
- return children.size() == 0;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Child(this, name));
- }
-
- /* can only have one child */
- public Child child() {
- return (children.isEmpty()) ? null : (Child) children.get(0);
- }
- }
-
-
- private static class Child extends TreeNode
- {
- public Child(TreeNode parent, String name) {
- super(parent, name);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
deleted file mode 100644
index d8fa173036..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.jpt.ui.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUi;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-
-public class JpaPlatformUiExtensionTests extends TestCase
-{
- protected TestJpaProject testProject;
-
- protected static final String PROJECT_NAME = "ExtensionTestProject";
- protected static final String PACKAGE_NAME = "extension.test";
-
- public static final String TEST_PLUGIN_CLASS = ExtensionTestPlugin.class.getName();
- public static final String TEST_PLUGIN_ID = ExtensionTestPlugin.PLUGIN_ID;
-
- public static final String TEST_PLATFORM_ID = TestJpaPlatform.ID;
- public static final String TEST_PLATFORM_CLASS = TestJpaPlatform.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- public static final String TEST_UI_PLATFORM_ID = TEST_PLATFORM_ID;
- public static final String TEST_UI_PLATFORM_CLASS = TestJpaPlatformUi.class.getName();
-
- public JpaPlatformUiExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.testProject.getProject().delete(true, true, null);
- this.testProject = null;
- super.tearDown();
- }
-
- protected JpaProject jpaProject() {
- return this.testProject.getJpaProject();
- }
-
- public void testJpaPlatform() {
- assertNotNull(JpaPlatformRegistry.instance().getJpaPlatform(jpaProject().getJpaPlatform().getId()));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java
deleted file mode 100644
index 50bcc99cfc..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.platform;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUiPlatformTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiPlatformTests.class.getPackage().getName());
- suite.addTestSuite(JpaPlatformUiExtensionTests.class);
- return suite;
- }
-
- private JptUiPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java
deleted file mode 100644
index eb4c175513..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public abstract class AbstractComboModelAdapterTest {
-
- private Model model;
- private WritablePropertyValueModel<SimpleDisplayable> selectedItemHolder;
- private Shell shell;
- private WritablePropertyValueModel<Model> subjectHolder;
-
- protected abstract AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter();
-
- protected final ListValueModel<SimpleDisplayable> buildEmptyListHolder() {
- return new SimpleListValueModel<SimpleDisplayable>();
- }
-
- private List<SimpleDisplayable> buildList() {
- List<SimpleDisplayable> list = new ArrayList<SimpleDisplayable>();
- populateCollection(list);
- return list;
- }
-
- protected final ListValueModel<SimpleDisplayable> buildListHolder() {
- return new ListAspectAdapter<Model, SimpleDisplayable>(subjectHolder, Model.ITEMS_LIST) {
- @Override
- protected ListIterator<SimpleDisplayable> listIterator_() {
- return subject.items();
- }
-
- @Override
- protected int size_() {
- return subject.itemsSize();
- }
- };
- }
-
- protected abstract AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter();
-
- private SimpleDisplayable buildSelectedItem() {
- return new SimpleDisplayable("baz");
- }
-
- private WritablePropertyValueModel<SimpleDisplayable> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Model, SimpleDisplayable>(subjectHolder, Model.ITEM_PROPERTY) {
- @Override
- protected SimpleDisplayable buildValue_() {
- return subject.getItem();
- }
-
- @Override
- protected void setValue_(SimpleDisplayable value) {
- subject.setItem(value);
- }
- };
- }
-
- protected final StringConverter<SimpleDisplayable> buildStringConverter() {
- return new StringConverter<SimpleDisplayable>() {
- public String convertToString(SimpleDisplayable value) {
- return (value == null) ? "" : value.displayString();
- }
- };
- }
-
- private WritablePropertyValueModel<Model> buildSubjectHolder() {
- return new SimplePropertyValueModel<Model>();
- }
-
- public abstract String comboSelectedItem();
-
- protected abstract boolean emptyComboCanHaveSelectedValue();
-
- protected abstract String itemAt(int index);
-
- protected abstract int itemCounts();
-
- private void populateCollection(Collection<SimpleDisplayable> c) {
- c.add(new SimpleDisplayable("foo"));
- c.add(new SimpleDisplayable("bar"));
- c.add(new SimpleDisplayable("baz"));
- c.add(new SimpleDisplayable("joo"));
- c.add(new SimpleDisplayable("jar"));
- c.add(new SimpleDisplayable("jaz"));
- }
-
- protected final WritablePropertyValueModel<SimpleDisplayable> selectedItemHolder() {
- return selectedItemHolder;
- }
-
- @Before
- public void setUp() throws Exception {
-
- shell = new Shell(Display.getCurrent());
- model = new Model();
- subjectHolder = buildSubjectHolder();
- selectedItemHolder = buildSelectedItemHolder();
- }
-
- protected final Shell shell() {
- return shell;
- }
-
- protected final WritablePropertyValueModel<Model> subjectHolder() {
- return subjectHolder;
- }
-
- @After
- public void tearDown() throws Exception {
-
- if (!shell.isDisposed()) {
- shell.dispose();
- }
-
- shell = null;
- subjectHolder = null;
- selectedItemHolder = null;
- }
-
- private void testItems() {
-
- assertEquals(
- "The count of items is not in sync with the model",
- model.itemsSize(),
- itemCounts()
- );
-
- for (int index = 0; index < model.itemsSize(); index++) {
- assertEquals(
- "The item at index " + index + " is not the same between the model and the combo",
- model.itemAt(index).displayString(),
- itemAt(index)
- );
- }
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedAfter_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
- testRemoveItems_AddedAfter();
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedAfter_RemoveItems_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
- testRemoveItems_AddedAfter();
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedBefore_RemoveItems_Editable() throws Exception {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- buildEditableComboModelAdapter();
- testSelectedItem(null);
- testItems();
-
- ArrayList<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- items.add(model.itemAt(0));
- items.add(model.itemAt(3));
- model.removeItems(items.iterator());
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedBefore_RemoveItems_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- buildReadOnlyComboModelAdapter();
- testSelectedItem(null);
- testItems();
-
- ArrayList<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- items.add(model.itemAt(0));
- items.add(model.itemAt(3));
- model.removeItems(items.iterator());
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterAfter_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterAfter_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterBefore_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
-
- model.addItems(buildList());
- subjectHolder.setValue(model);
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterBefore_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
-
- model.addItems(buildList());
- subjectHolder.setValue(model);
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsBefore_Editable() throws Exception {
-
- model.addItems(buildList());
- buildEditableComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsBefore_ReadOnly() throws Exception {
-
- model.addItems(buildList());
- buildReadOnlyComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_NoItems_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_NoItems_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_SelectedItemChanged_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- SimpleDisplayable selectedItem = model.itemAt(0);
-
- AbstractComboModelAdapter<SimpleDisplayable> adapter = buildEditableComboModelAdapter();
- SelectionListener selectionListener = new SelectionListener();
- adapter.addSelectionChangeListener(selectionListener);
-
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
- testSelectedItem(null);
-
- testSelectedItemChanged(selectedItem, selectionListener);
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_Editable() throws Exception {
-
- SimpleDisplayable selectedItem = buildSelectedItem();
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_Items_Editable() throws Exception {
-
- SimpleDisplayable selectedItem = buildSelectedItem();
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_Items_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_Editable() throws Exception {
-
- model.addItems(buildList());
- SimpleDisplayable selectedItem = model.itemAt(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_Items_Editable() throws Exception {
-
- model.addItems(buildList());
- SimpleDisplayable selectedItem = model.itemAt(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_Items_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_Items_Editable() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_Items_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_NoItems_Editable() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_NoItems_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_SelectedItemChanged_Editable() throws Exception {
-
- model.addItems(buildList());
-
- SimpleDisplayable selectedItem = model.itemAt(3);
- subjectHolder.setValue(model);
-
- AbstractComboModelAdapter<SimpleDisplayable> adapter = buildEditableComboModelAdapter();
- SelectionListener selectionListener = new SelectionListener();
- adapter.addSelectionChangeListener(selectionListener);
-
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
- testSelectedItem(null);
-
- testSelectedItemChanged(selectedItem, selectionListener);
- }
-
- private void testNullSubject() throws Exception {
-
- assertNull("The selected item should be null", selectedItemHolder.getValue());
-
- selectedItemHolder.setValue(buildSelectedItem());
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
-
- // Null because the subject holder doesn't have the subject set
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_Items_Editable() throws Exception {
- buildEditableComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_Items_ReadOnly() throws Exception {
- buildReadOnlyComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_NoItems_Editable() throws Exception {
- buildEditableComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_NoItems_ReadOnly() throws Exception {
- buildReadOnlyComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- private void testRemoveItems_AddedAfter() {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- testSelectedItem(null);
- testItems();
- testSelectedItem(null);
-
- ArrayList<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- items.add(model.itemAt(0));
- items.add(model.itemAt(3));
- model.removeItems(items.iterator());
-
- testItems();
- testSelectedItem(null);
- }
-
- private void testSelectedItem(SimpleDisplayable selectedItem) {
-
- if (selectedItem == null) {
-
- assertNull(
- "The selected item is supposed to be null",
- model.getItem()
- );
-
- assertEquals(
- "The combo's selected item should be null",
- "",
- comboSelectedItem()
- );
- }
- else if (!emptyComboCanHaveSelectedValue()) {
-
- assertEquals(
- "The selected item wasn't set correctly",
- selectedItem,
- model.getItem()
- );
-
- assertEquals(
- "The combo's selected item should be null",
- "",
- comboSelectedItem()
- );
- }
- else {
-
- assertEquals(
- "The selected item wasn't set correctly",
- selectedItem,
- model.getItem()
- );
-
- assertEquals(
- "The selected item wasn't set correctly",
- selectedItem.displayString(),
- comboSelectedItem()
- );
- }
- }
-
- private void testSelectedItemChanged(SimpleDisplayable selectedItem,
- SelectionListener selectionListener) {
-
- // Test 1
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
-
- // Test 2
- selectedItem = model.itemAt(1);
- model.clearItemCalledFlag();
- selectionListener.clearInfo();
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
-
- // Test 3
- selectedItem = null;
- model.clearItemCalledFlag();
- selectionListener.clearInfo();
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item wasn't set properly", model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
-
- // Test 3
- selectedItem = model.itemAt(2);
- model.clearItemCalledFlag();
- selectionListener.clearInfo();
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
- }
-
- private static class Model extends AbstractModel {
-
- private SimpleDisplayable item;
- private List<SimpleDisplayable> items;
- private boolean setItemCalled;
-
- static final String ITEM_PROPERTY = "item";
- static final String ITEMS_LIST = "items";
-
- void addItems(Iterator<SimpleDisplayable> items) {
- addItemsToList(items, this.items, ITEMS_LIST);
- }
-
- void addItems(List<SimpleDisplayable> items) {
- addItemsToList(items, this.items, ITEMS_LIST);
- }
-
- void clearItemCalledFlag() {
- setItemCalled = false;
- }
-
- SimpleDisplayable getItem() {
- return item;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- items = new ArrayList<SimpleDisplayable>();
- }
-
- boolean isSetItemCalled() {
- return setItemCalled;
- }
-
- SimpleDisplayable itemAt(int index) {
- return this.items.get(index);
- }
-
- ListIterator<SimpleDisplayable> items() {
- return items.listIterator();
- }
-
- int itemsSize() {
- return items.size();
- }
-
- void removeItems(Iterator<SimpleDisplayable> items) {
- removeItemsFromList(items, this.items, ITEMS_LIST);
- }
-
- void setItem(SimpleDisplayable item) {
- setItemCalled = true;
-
- SimpleDisplayable oldItem = this.item;
- this.item = item;
- firePropertyChanged(ITEM_PROPERTY, oldItem, item);
- }
- }
-
- private class SelectionListener implements SelectionChangeListener<SimpleDisplayable> {
-
- private SimpleDisplayable item;
- private boolean listenerNotified;
-
- void clearInfo() {
- this.listenerNotified = false;
- this.item = null;
- }
-
- SimpleDisplayable getItem() {
- return item;
- }
-
- public boolean isListenerNotified() {
- return listenerNotified;
- }
-
- public void selectionChanged(SelectionChangeEvent<SimpleDisplayable> e) {
- listenerNotified = true;
- item = e.selectedItem();
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java
deleted file mode 100644
index 4cf143eb90..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.CComboModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.junit.After;
-
-public class CComboModelAdapterTest extends AbstractComboModelAdapterTest {
-
- private CCombo combo;
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter() {
-
- combo = new CCombo(shell(), SWT.NULL);
-
- return CComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter() {
-
- combo = new CCombo(shell(), SWT.READ_ONLY);
-
- return CComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- public String comboSelectedItem() {
- return combo.getText();
- }
-
- @Override
- protected boolean emptyComboCanHaveSelectedValue() {
- return true;
- }
-
- @Override
- protected String itemAt(int index) {
- return this.combo.getItem(index);
- }
-
- @Override
- protected int itemCounts() {
- return combo.getItemCount();
- }
-
- @After
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- combo = null;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index d2cf139f45..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.BooleanButtonModelAdapter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Play around with a set of check boxes.
- */
-public class CheckBoxModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<Boolean> flag1Holder;
- private final WritablePropertyValueModel<Boolean> flag2Holder;
- private final WritablePropertyValueModel<Boolean> notFlag2Holder;
-
- public static void main(String[] args) throws Exception {
- Window window = new CheckBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private CheckBoxModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(true, true);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag1());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNotFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value.booleanValue());
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control checkBoxPanel = this.buildCheckBoxPanel(mainPanel);
- this.buildControlPanel(mainPanel, checkBoxPanel);
- return mainPanel;
- }
-
- private Control buildCheckBoxPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlag1CheckBox(panel);
- this.buildFlag2CheckBox(panel);
- this.buildNotFlag2CheckBox(panel);
- this.buildUnattachedCheckBox(panel);
-
- return panel;
- }
-
- private void buildFlag1CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 1");
- BooleanButtonModelAdapter.adapt(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 2");
- BooleanButtonModelAdapter.adapt(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("not flag 2");
- BooleanButtonModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildUnattachedCheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("unattached");
- checkBox.addSelectionListener(this.buildUnattachedSelectionListener());
- }
-
- private SelectionListener buildUnattachedSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- System.out.println("unattached default selected: " + e);
- }
- public void widgetSelected(SelectionEvent e) {
- System.out.println("unattached selected: " + e);
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlipFlag1Button(panel);
- this.buildNotFlag2ToggleButton(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildFlipFlag1Button(Composite parent) {
- this.buildFlipFlag1ACI().fill(parent);
- }
-
- private ActionContributionItem buildFlipFlag1ACI() {
- Action action = new Action("flip flag 1", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.flipFlag1();
- }
- };
- action.setToolTipText("flip flag 1");
- return new ActionContributionItem(action);
- }
-
- void flipFlag1() {
- this.testModel.setFlag1( ! this.testModel.isFlag1());
- }
-
- private void buildNotFlag2ToggleButton(Composite parent) {
- Button checkBox = new Button(parent, SWT.TOGGLE);
- checkBox.setText("not flag 2");
- BooleanButtonModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(boolean flag1, boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = ! flag2;
- }
- public boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(boolean flag1) {
- boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(boolean flag2) {
- boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = ! flag2;
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(boolean notFlag2) {
- this.setFlag2( ! notFlag2);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java
deleted file mode 100644
index 0fb152a17f..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.ComboModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Combo;
-import org.junit.After;
-
-public class ComboModelAdapterTest extends AbstractComboModelAdapterTest {
-
- private Combo combo;
- private boolean editable;
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter() {
-
- combo = new Combo(shell(), SWT.NULL);
- editable = true;
-
- return ComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter() {
-
- combo = new Combo(shell(), SWT.READ_ONLY);
- editable = false;
-
- return ComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- public String comboSelectedItem() {
- return combo.getText();
- }
-
- @Override
- protected boolean emptyComboCanHaveSelectedValue() {
- return editable;
- }
-
- @Override
- protected String itemAt(int index) {
- return this.combo.getItem(index);
- }
-
- @Override
- protected int itemCounts() {
- return combo.getItemCount();
- }
-
- @After
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- combo = null;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java
deleted file mode 100644
index 12a8c2fbce..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@SuiteClasses
-({
- CComboModelAdapterTest.class,
- ComboModelAdapterTest.class,
- SpinnerModelAdapterTest.class,
- TableModelAdapterTest.class
-})
-@RunWith(Suite.class)
-public final class JptUiSWTTests {
-
- private JptUiSWTTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new JUnit4TestAdapter(JptUiSWTTests.class));
- return suite;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java
deleted file mode 100644
index b3efc50bfa..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * an example UI for testing various permutations of the
- * StructuredContentProviderAdapter
- */
-public class ListBoxModelAdapterUITest
- extends ApplicationWindow
-{
- final TaskList taskList;
- private final WritablePropertyValueModel<TaskList> taskListHolder;
- private Text taskTextField;
-
- public static void main(String[] args) throws Exception {
- Window window = new ListBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private ListBoxModelAdapterUITest(String[] args) {
- super(null);
- this.taskList = new TaskList();
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(this.taskList);
- this.taskList.addTask("swim");
- this.taskList.addTask("bike");
- this.taskList.addTask("run");
- Task rest = this.taskList.addTask("rest");
- this.taskList.addPriorityTask(rest);
- Task repeat = this.taskList.addTask("repeat");
- this.taskList.addPriorityTask(repeat);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(800, 400);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control taskListPanel = this.buildTaskListPanel(mainPanel);
- this.buildControlPanel(mainPanel, taskListPanel);
- return mainPanel;
- }
-
- private Control buildTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -30);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- this.buildPrimitiveTaskListPanel(panel);
- this.buildObjectTaskListPanel(panel);
-
- return panel;
- }
-
- private void buildPrimitiveTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(50);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedPrimitiveListPanel(panel);
- this.buildStandardSortedPrimitiveListPanel(panel);
- this.buildCustomSortedPrimitiveListPanel(panel);
- }
-
- private void buildObjectTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(50);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedObjectListPanel(panel);
- this.buildStandardSortedObjectListPanel(panel);
- this.buildCustomSortedObjectListPanel(panel);
- }
-
- private void buildUnsortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive unsorted", this.buildUnsortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildStandardSortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive sorted", this.buildStandardSortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildCustomSortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive reverse sorted", this.buildCustomSortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildUnsortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object unsorted", this.buildUnsortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildStandardSortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object sorted", this.buildStandardSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildCustomSortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object reverse sorted", this.buildCustomSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private ListValueModel<String> buildUnsortedPrimitiveListModel() {
- return this.buildPrimitiveTaskListAdapter();
- }
-
- private ListValueModel<String> buildStandardSortedPrimitiveListModel() {
- return new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListValueModel<String> buildCustomSortedPrimitiveListModel() {
- return new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator());
- }
-
- private ListValueModel<Task> buildUnsortedObjectListModel() {
- return this.buildObjectTaskListAdapter();
- }
-
- private ListValueModel<Task> buildStandardSortedObjectListModel() {
- return new SortedListValueModelAdapter<Task>(this.buildObjectTaskListAdapter());
- }
-
- private ListValueModel<Task> buildCustomSortedObjectListModel() {
- return new SortedListValueModelAdapter<Task>(this.buildObjectTaskListAdapter(), this.buildCustomTaskComparator());
- }
-
- private <E> ListBoxModelAdapter<E> buildListPanel(Composite parent, String label, ListValueModel<E> model, CollectionValueModel<E> selectedItemsModel) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new FormLayout());
-
- Label listLabel = new Label(panel, SWT.LEFT | SWT.VERTICAL);
- listLabel.setText(label);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0, 3);
- fd.bottom = new FormAttachment(0, 20);
- fd.left = new FormAttachment(0, 5);
- fd.right = new FormAttachment(100);
- listLabel.setLayoutData(fd);
-
- org.eclipse.swt.widgets.List listBox = new org.eclipse.swt.widgets.List(panel, SWT.MULTI | SWT.BORDER);
- fd = new FormData();
- fd.top = new FormAttachment(listLabel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- listBox.setLayoutData(fd);
- return ListBoxModelAdapter.adapt(model, selectedItemsModel, listBox); // use #toString()
- }
-
- private void buildListPanel2(Composite parent, String label, ListValueModel<Task> model, CollectionValueModel<Task> selectedItemsModel) {
- ListBoxModelAdapter<Task> adapter = this.buildListPanel(parent, label, model, selectedItemsModel);
- adapter.addDoubleClickListener(this.buildDoubleClickListener());
- adapter.addSelectionChangeListener(this.buildSelectionChangeListener());
- }
-
- private ListBoxModelAdapter.DoubleClickListener<Task> buildDoubleClickListener() {
- return new ListBoxModelAdapter.DoubleClickListener<Task>() {
- public void doubleClick(ListBoxModelAdapter.DoubleClickEvent<Task> event) {
- System.out.println("double-click: " + event.selection());
- }
- };
- }
-
- private ListBoxModelAdapter.SelectionChangeListener<Task> buildSelectionChangeListener() {
- return new ListBoxModelAdapter.SelectionChangeListener<Task>() {
- public void selectionChanged(SelectionChangeEvent<Task> event) {
- ListBoxModelAdapterUITest.this.taskList.setPriorityTasks(event.selection());
- }
- };
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.compareTo(to1);
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(this.taskListHolder, TaskList.TASK_NAMES_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildObjectTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.TASKS_LIST) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private CollectionValueModel<Task> buildPriorityTaskListAdapter() {
- return new CollectionAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.PRIORITY_TASKS_COLLECTION) {
- @Override
- protected Iterator<Task> iterator_() {
- return this.subject.priorityTasks();
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control taskListPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(taskListPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control misc = this.buildMiscTaskPanel(panel);
- this.buildAddRemoveTaskPanel(panel, misc);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildMiscTaskPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -400);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildClearListACI().fill(panel);
- this.buildClearModelACI().fill(panel);
- this.buildRestoreModelACI().fill(panel);
- this.buildAddPriorityTaskACI().fill(panel);
- this.buildRemovePriorityTaskACI().fill(panel);
- this.buildClearPriorityTasksACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildClearListACI() {
- Action action = new Action("clear list", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.clearTasks();
- }
- };
- action.setToolTipText("clear all the tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildAddPriorityTaskACI() {
- Action action = new Action("add priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.addPriorityTask();
- }
- };
- action.setToolTipText("add a task to the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRemovePriorityTaskACI() {
- Action action = new Action("remove priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.removePriorityTask();
- }
- };
- action.setToolTipText("remove a task from the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearPriorityTasksACI() {
- Action action = new Action("clear priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.clearPriorityTasks();
- }
- };
- action.setToolTipText("clear the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private void buildAddRemoveTaskPanel(Composite parent, Control clearButton) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(clearButton);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control addButton = this.buildAddButton(panel);
- Control removeButton = this.buildRemoveButton(panel);
- this.buildTaskTextField(panel, addButton, removeButton);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildAddButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(0, 50);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildAddACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildAddACI() {
- Action action = new Action("add", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.addTask();
- }
- };
- action.setToolTipText("add a task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildRemoveButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -50);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildRemoveACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildRemoveACI() {
- Action action = new Action("remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.removeTask();
- }
- };
- action.setToolTipText("remove the task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- private void buildTaskTextField(Composite parent, Control addButton, Control removeButton) {
- this.taskTextField = new Text(parent, SWT.SINGLE | SWT.BORDER);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(addButton);
- fd.right = new FormAttachment(removeButton);
- this.taskTextField.setLayoutData(fd);
- }
-
- private String taskTextFieldText() {
- return this.taskTextField.getText();
- }
-
- void addTask() {
- String taskText = this.taskTextFieldText();
- if (taskText.length() != 0) {
- this.taskList.addTask(taskText);
- }
- }
-
- void removeTask() {
- String task = this.taskTextFieldText();
- if (task.length() != 0) {
- this.taskList.removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList.clearTasks();
- }
-
- void clearModel() {
- this.taskListHolder.setValue(null);
- }
-
- void restoreModel() {
- this.taskListHolder.setValue(this.taskList);
- }
-
- void addPriorityTask() {
- Iterator<Task> tasks = this.taskList.tasks();
- while (tasks.hasNext()) {
- if (this.taskList.addPriorityTask(tasks.next())) {
- return;
- }
- }
- }
-
- void removePriorityTask() {
- Iterator<Task> pTasks = this.taskList.priorityTasks();
- if (pTasks.hasNext()) {
- this.taskList.removePriorityTask(pTasks.next());
- }
- }
-
- void clearPriorityTasks() {
- this.taskList.clearPriorityTasks();
- }
-
-
- // ********** TaskList **********
-
- // note absence of validation...
- private class TaskList extends AbstractModel {
- private final List<String> taskNames = new ArrayList<String>();
- public static final String TASK_NAMES_LIST = "taskNames";
- private final List<Task> tasks = new ArrayList<Task>();
- public static final String TASKS_LIST = "tasks";
- private final Collection<Task> priorityTasks = new HashSet<Task>();
- public static final String PRIORITY_TASKS_COLLECTION = "priorityTasks";
- TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public ListIterator<Task> tasks() {
- return this.tasks.listIterator();
- }
- public Iterator<Task> priorityTasks() {
- return this.priorityTasks.iterator();
- }
- public Task addTask(String taskName) {
- this.addItemToList(taskName, this.taskNames, TASK_NAMES_LIST);
- Task task = new Task(taskName);
- this.addItemToList(task, this.tasks, TASKS_LIST);
- return task;
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- this.removeItemFromList(index, this.taskNames, TASK_NAMES_LIST);
- // assume the indexes match...
- Task removedTask = this.removeItemFromList(index, this.tasks, TASKS_LIST);
- this.removeItemFromCollection(removedTask, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- }
- public void clearTasks() {
- this.taskNames.clear();
- this.fireListCleared(TASK_NAMES_LIST);
- this.tasks.clear();
- this.fireListCleared(TASKS_LIST);
- }
- public boolean addPriorityTask(Task task) {
- return this.addItemToCollection(task, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void removePriorityTask(Task task) {
- this.removeItemFromCollection(task, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void clearPriorityTasks() {
- this.clearCollection(this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void setPriorityTasks(Iterator<Task> tasks) {
- this.priorityTasks.clear();
- while (tasks.hasNext()) {
- this.priorityTasks.add(tasks.next());
- }
- this.fireCollectionChanged(PRIORITY_TASKS_COLLECTION);
- }
- }
-
-
- // ********** Task **********
-
- private class Task extends AbstractModel implements Displayable {
- private String name;
- private Date creationTimeStamp;
- public Task(String name) {
- this.name = name;
- this.creationTimeStamp = new Date();
- }
- public String displayString() {
- return this.name + ": " + this.creationTimeStamp.getTime();
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return this.displayString();
- }
- }
-
- public interface Displayable extends Model, Comparable<Displayable> {
-
- String displayString();
- String DISPLAY_STRING_PROPERTY = "displayString";
-
-
- // ********** helper implementations **********
-
- Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- Comparator<Displayable> DEFAULT_COMPARATOR =
- new Comparator<Displayable>() {
- public int compare(Displayable d1, Displayable d2) {
- // disallow duplicates based on object identity
- if (d1 == d2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = DEFAULT_COLLATOR.compare(d1.displayString(), d2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(d1) - System.identityHashCode(d2);
- if (result != 0) {
- return result;
- }
-
- // It's unlikely that we get to this point; but, just in case, we will return -1.
- // Unfortunately, this introduces some mild unpredictability to the sort order
- // (unless the objects are always passed into this method in the same order).
- return -1; // if all else fails, indicate that o1 < o2
- }
- @Override
- public String toString() {
- return "Displayable.DEFAULT_COMPARATOR";
- }
- };
-
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java
deleted file mode 100644
index bd343778a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jpt.ui.internal.swt.SpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public class SpinnerModelAdapterTest {
-
- private Model model;
- private Shell shell;
- private WritablePropertyValueModel<Model> subjectHolder;
-
- private WritablePropertyValueModel<Model> buildSubjectHolder() {
- return new SimplePropertyValueModel<Model>();
- }
-
- private WritablePropertyValueModel<Integer> buildValueHolder() {
- return new PropertyAspectAdapter<Model, Integer>(subjectHolder, Model.VALUE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return subject.getValue();
- }
-
- @Override
- protected void setValue_(Integer value) {
- subject.setValue(value);
- }
- };
- }
-
- @Before
- public void setUp() throws Exception {
-
- shell = new Shell(Display.getCurrent());
- model = new Model();
- subjectHolder = buildSubjectHolder();
- }
-
- @After
- public void tearDown() throws Exception {
-
- if (!shell.isDisposed()) {
- shell.dispose();
- }
-
- shell = null;
- subjectHolder = null;
- }
-
- @Test
- public void testDisposed() {
-
- int value = 2;
- model.setValue(value);
- model.clearSetValueCalledFlag();
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The number holder's value should be the model's value",
- model.getValue(),
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
-
- // Change the value in the model
- spinner.dispose();
-
- value = 4;
- model.setValue(value);
-
- assertEquals(
- "The model's value was somehow changed",
- value,
- model.getValue()
- );
- }
-
- @Test
- public void testInitialization_1() {
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = new SimplePropertyValueModel<Integer>();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
-
- assertNull(
- "The number holder's value should be null",
- numberHolder.getValue()
- );
- }
-
- @Test
- public void testInitialization_2() {
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
-
- assertNull(
- "The number holder's value should be null",
- numberHolder.getValue()
- );
- }
-
- @Test
- public void testInitialization_3() {
-
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
-
- assertNull(
- "The number holder's value should be null",
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
- }
-
- @Test
- public void testInitialization_4() {
-
- int value = 2;
- model.setValue(value);
- model.clearSetValueCalledFlag();
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the value coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The number holder's value should be " + value,
- value,
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
- }
-
- @Test
- public void testValueChanged() {
-
- int value = 2;
- model.setValue(value);
- model.clearSetValueCalledFlag();
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The number holder's value should be the model's value",
- model.getValue(),
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
-
- // Change the value in the model
- value = 4;
- model.setValue(value);
-
- assertEquals(
- "The spinner's value should be coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The model's value was somehow changed",
- value,
- model.getValue()
- );
-
- // Change the value from the spinner
- value = 6;
- spinner.setSelection(value);
-
- assertEquals(
- "The spinner's value should be the new value set",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The model's value was supposed to be updated",
- value,
- model.getValue()
- );
-
- // Disconnect from model
- subjectHolder.setValue(null);
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
- }
-
- private static class Model extends AbstractModel {
-
- private boolean setValueCalled;
- private Integer value;
-
- static final String VALUE_PROPERTY = "value";
-
- void clearSetValueCalledFlag() {
- setValueCalled = false;
- }
-
- Integer getValue() {
- return value;
- }
-
- boolean isSetValueCalled() {
- return setValueCalled;
- }
-
- void setValue(Integer value) {
- setValueCalled = true;
-
- Integer oldValue = this.value;
- this.value = value;
- firePropertyChanged(VALUE_PROPERTY, oldValue, value);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java
deleted file mode 100644
index 94da99053b..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java
+++ /dev/null
@@ -1,1203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.TableModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.ui.internal.swt.TableModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public class TableModelAdapterTest {
-
- private Shell shell;
- private WritablePropertyValueModel<Manager> subjectHolder;
-
- private ColumnAdapter<Employee> buildColumnAdapter() {
- return new TableColumnAdapter();
- }
-
- private WritablePropertyValueModel<Employee> buildEmployeeHolder() {
- return new SimplePropertyValueModel<Employee>();
- }
-
- private SimpleCollectionValueModel<Employee> buildEmployeeHolders() {
- return new SimpleCollectionValueModel<Employee>();
- }
-
- private ListValueModel<Employee> buildEmployeeListHolder() {
- return new ListAspectAdapter<Manager, Employee>(subjectHolder, Manager.EMPLOYEES_LIST) {
- @Override
- protected ListIterator<Employee> listIterator_() {
- return subject.employees();
- }
-
- @Override
- protected int size_() {
- return subject.employeesSize();
- }
- };
- }
-
- private ITableLabelProvider buildLabelProvider() {
- return new TableLabelProvider();
- }
-
- private SelectionChangeListener<Employee> buildSelectionChangeListener(final Collection<Employee> employees) {
- return new SelectionChangeListener<Employee>() {
- public void selectionChanged(SelectionChangeEvent<Employee> e) {
- employees.clear();
- CollectionTools.addAll(employees, e.selection());
- }
- };
- }
-
- private WritablePropertyValueModel<Manager> buildSubjectHolder() {
- return new SimplePropertyValueModel<Manager>();
- }
-
- @Before
- public void setUp() throws Exception {
-
- shell = new Shell(Display.getCurrent());
- subjectHolder = buildSubjectHolder();
- }
-
- @After
- public void tearDown() throws Exception {
-
- if (!shell.isDisposed()) {
- shell.dispose();
- }
-
- shell = null;
- subjectHolder = null;
- }
-
- @Test
- public void testChanged() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Make sure the Table was populated
- Assert.assertEquals("The number of TableItems should be 3", 3, table.getItemCount());
-
- // Change the list of Employees
- ArrayList<Employee> employees = new ArrayList<Employee>(3);
- employees.add(employee3);
- employees.add(employee2);
- employees.add(employee1);
- manager.changeEmployees(employees);
-
- Assert.assertEquals("The number of TableItems should be 3", 3, table.getItemCount());
-
- testTableItemProperties(table, 0, expectedName3, expectedManager3, expectedTitle3);
- testTableItemProperties(table, 1, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, 2, expectedName1, expectedManager1, expectedTitle1);
- }
-
- @Test
- public void testCleared() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Make sure the Table was populated
- Assert.assertEquals("The number of TableItems should be 3", 3, table.getItemCount());
-
- // Test removing them all
- manager.removeAllEmployees();
-
- Assert.assertEquals("The list holder should have been cleared", 0, listHolder.size());
- Assert.assertEquals("The Table should have been cleared", 0, table.getItemCount());
- }
-
- @Test
- public void testItemAdded() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName = "Dali";
- String expectedManager = "WTP";
- String expectedTitle = "plug-in";
-
- Employee employee = manager.addEmployee(expectedName, expectedTitle, expectedManager);
- Assert.assertNotNull("The new Employee was not created", employee);
-
- // Retrieve the TableItem representing the new Employee
- int index = tableModel.indexOf(employee);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- testTableItemProperties(table, index, expectedName, expectedManager, expectedTitle);
- }
-
- @Test
- public void testItemMoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Make sure the Employees were added to the Table
- Assert.assertEquals("The number of TableItem should be 3", 3, table.getItemCount());
-
- // Move an Employee up the list
- manager.moveEmployeeUp(employee2);
-
- int index1 = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 was not moved in the table model", 1, index1);
-
- int index2 = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not moved in the table model", 0, index2);
-
- int index3 = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 should not have been moved in the table model", 2, index3);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
-
- // Move an Employee down the list
- manager.moveEmployeeDown(employee1);
-
- index1 = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 should not have been moved in the table model", 2, index1);
-
- index2 = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not moved in the table model", 0, index2);
-
- index3 = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 was not moved in the table model", 1, index3);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
- }
-
- @Test
- public void testItemRemoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName = "Dali";
- String expectedManager = "WTP";
- String expectedTitle = "plug-in";
-
- Employee employee = manager.addEmployee(expectedName, expectedTitle, expectedManager);
- Assert.assertNotNull("The new Employee was not created", employee);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- // Make sure it was added to the model
- int index = tableModel.indexOf(employee);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index);
- testTableItemProperties(table, index, expectedName, expectedManager, expectedTitle);
-
- // Retrieve the TableItem representing the new Employee
- TableItem tableItem = table.getItem(index);
- Assert.assertNotNull("No TableItem was found for the new Employee", tableItem);
-
- // Now test the item being removed
- manager.removeEmployee(employee);
- index = tableModel.indexOf(employee);
- Assert.assertEquals("The Employee was not removed from the table model", -1, index);
- Assert.assertEquals("The number of TableItem should be 0", 0, table.getItemCount());
- }
-
- @Test
- public void testItemReplaced() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- Employee employee1 = manager.addEmployee(expectedName1, expectedTitle1, expectedManager1);
- Assert.assertNotNull("The new Employee was not created", employee1);
-
- // Make sure it was added to the model
- int index1 = tableModel.indexOf(employee1);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index1);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- // Retrieve the TableItem representing the new Employee
- TableItem tableItem = table.getItem(index1);
- Assert.assertNotNull("No TableItem was found for the new Employee", tableItem);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
-
- // Replace the Employee
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- manager.replace(employee1, employee2);
-
- int index2 = tableModel.indexOf(employee2);
- Assert.assertSame("The Employee that got replaced should be at index " + index1, index1, index2);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- }
-
- @Test
- public void testItemsAdded() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Retrieve the TableItems representing the employees
- Assert.assertEquals("The number of TableItem should be 3", 3, table.getItemCount());
-
- int index = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 was not added to the table model", 0, index);
-
- index = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not added to the table model", 1, index);
-
- index = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 was not added to the table model", 2, index);
-
- // Make sure the TableItem was correctly populated
- testTableItemProperties(table, 0, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, 1, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, 2, expectedName3, expectedManager3, expectedTitle3);
- }
-
- @Test
- public void testItemsMoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- String expectedName4 = "Dali_4";
- String expectedManager4 = "WTP_4";
- String expectedTitle4 = "plug-in_4";
-
- String expectedName5 = "Dali_5";
- String expectedManager5 = "WTP_5";
- String expectedTitle5 = "plug-in_5";
-
- String expectedName6 = "Dali_6";
- String expectedManager6 = "WTP_6";
- String expectedTitle6 = "plug-in_6";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
- Employee employee4 = new Employee(expectedName4, expectedTitle4, expectedManager4);
- Employee employee5 = new Employee(expectedName5, expectedTitle5, expectedManager5);
- Employee employee6 = new Employee(expectedName6, expectedTitle6, expectedManager6);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
- manager.addEmployee(employee4);
- manager.addEmployee(employee5);
- manager.addEmployee(employee6);
-
- // Make sure the Employees were added to the Table
- Assert.assertEquals("The number of TableItem should be 6", 6, table.getItemCount());
-
- // Move an Employee up the list
- ArrayList<Employee> employees = new ArrayList<Employee>(3);
- employees.add(employee3);
- employees.add(employee4);
- employees.add(employee5);
- manager.moveEmployees(employees, 0);
-
- int index1 = tableModel.indexOf(employee1);
- int index2 = tableModel.indexOf(employee2);
- int index3 = tableModel.indexOf(employee3);
- int index4 = tableModel.indexOf(employee4);
- int index5 = tableModel.indexOf(employee5);
- int index6 = tableModel.indexOf(employee6);
-
- Assert.assertEquals("The Employee 1 is not at the right index", 3, index1);
- Assert.assertEquals("The Employee 2 is not at the right index", 4, index2);
- Assert.assertEquals("The Employee 3 is not at the right index", 0, index3);
- Assert.assertEquals("The Employee 4 is not at the right index", 1, index4);
- Assert.assertEquals("The Employee 5 is not at the right index", 2, index5);
- Assert.assertEquals("The Employee 6 is not at the right index", 5, index6);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
- testTableItemProperties(table, index4, expectedName4, expectedManager4, expectedTitle4);
- testTableItemProperties(table, index5, expectedName5, expectedManager5, expectedTitle5);
- testTableItemProperties(table, index6, expectedName6, expectedManager6, expectedTitle6);
-
- // Move an Employee down the list
- employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee2);
- manager.moveEmployees(employees, 4);
-
- index1 = tableModel.indexOf(employee1);
- index2 = tableModel.indexOf(employee2);
- index3 = tableModel.indexOf(employee3);
- index4 = tableModel.indexOf(employee4);
- index5 = tableModel.indexOf(employee5);
- index6 = tableModel.indexOf(employee6);
-
- Assert.assertEquals("The Employee 1 is not at the right index", 4, index1);
- Assert.assertEquals("The Employee 2 is not at the right index", 5, index2);
- Assert.assertEquals("The Employee 3 is not at the right index", 0, index3);
- Assert.assertEquals("The Employee 4 is not at the right index", 1, index4);
- Assert.assertEquals("The Employee 5 is not at the right index", 2, index5);
- Assert.assertEquals("The Employee 6 is not at the right index", 3, index6);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
- testTableItemProperties(table, index4, expectedName4, expectedManager4, expectedTitle4);
- testTableItemProperties(table, index5, expectedName5, expectedManager5, expectedTitle5);
- testTableItemProperties(table, index6, expectedName6, expectedManager6, expectedTitle6);
- }
-
- @Test
- public void testItemsRemoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Retrieve the TableItems representing the employees
- Assert.assertEquals("The number of TableItem should be 3", 3, table.getItemCount());
-
- int index = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 was not added to the table model", 0, index);
-
- index = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not added to the table model", 1, index);
-
- index = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 was not added to the table model", 2, index);
-
- // Remove 2 items
- ArrayList<Employee> employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee3);
- manager.removeEmployees(employees);
-
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
- }
-
- @Test
- public void testPropertyChanged() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName = "Dali";
- String expectedManager = "WTP";
- String expectedTitle = "plug-in";
-
- Employee employee = manager.addEmployee(expectedName, expectedTitle, expectedManager);
- Assert.assertNotNull("The new Employee was not created", employee);
-
- // Make sure it was added to the model
- int index = tableModel.indexOf(employee);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- // Retrieve the TableItem representing the new Employee
- TableItem tableItem = table.getItem(index);
- Assert.assertNotNull("No TableItem was found for the new Employee", tableItem);
-
- // Name property
- String actualName = tableItem.getText(TableColumnAdapter.NAME_COLUMN);
- Assert.assertEquals("TableItem[NAME_COLUMN] was not set correctly", expectedName, actualName);
-
- expectedName = "Jpt";
- employee.setName(expectedName);
-
- actualName = tableItem.getText(TableColumnAdapter.NAME_COLUMN);
- Assert.assertEquals("TableItem[NAME_COLUMN] was not set correctly", expectedName, actualName);
-
- // Manager property
- String actualManager = tableItem.getText(TableColumnAdapter.MANAGER_COLUMN);
- Assert.assertEquals("TableItem[MANAGER_COLUMN] was not set correctly", expectedManager, actualManager);
-
- expectedManager = "boss";
- employee.setManager(expectedManager);
-
- actualManager = tableItem.getText(TableColumnAdapter.MANAGER_COLUMN);
- Assert.assertEquals("TableItem[MANAGER_COLUMN] was not set correctly", expectedManager, actualManager);
-
- // Title property
- String actualTitle = tableItem.getText(TableColumnAdapter.TITLE_COLUMN);
- Assert.assertEquals("TableItem[TITLE_COLUMN] was not set correctly", expectedTitle, actualTitle);
-
- expectedTitle = "EclipseLink";
- employee.setTitle(expectedTitle);
-
- actualTitle = tableItem.getText(TableColumnAdapter.TITLE_COLUMN);
- Assert.assertEquals("TableItem[TITLE_COLUMN] was not set correctly", expectedTitle, actualTitle);
- }
-
- @Test
- public void testSelectedItemsAddedRemoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- SimpleCollectionValueModel<Employee> selectedItemsHolder = buildEmployeeHolders();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemsHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Test adding selected items
- ArrayList<Employee> employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee3);
- selectedItemsHolder.addAll(employees);
-
- Collection<Employee> actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be 2", 2, actualEmployees.size());
-
- actualEmployees.remove(employee1);
- actualEmployees.remove(employee3);
-
- Assert.assertTrue("The selected items was not retrieved correctly", actualEmployees.isEmpty());
-
- // Test removing selected items
- selectedItemsHolder.remove(employee1);
-
- actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be 1", 1, actualEmployees.size());
-
- actualEmployees.remove(employee3);
-
- Assert.assertTrue("The selected items was not retrieved correctly", actualEmployees.isEmpty());
- }
-
- @Test
- public void testSelectedItemsCleared() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- SimpleCollectionValueModel<Employee> selectedItemsHolder = buildEmployeeHolders();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemsHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Test adding selected items
- ArrayList<Employee> employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee3);
- selectedItemsHolder.addAll(employees);
-
- Collection<Employee> actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be 2", 2, actualEmployees.size());
-
- actualEmployees.remove(employee1);
- actualEmployees.remove(employee3);
- Assert.assertTrue("The selected items was not retrieved correctly", actualEmployees.isEmpty());
-
- // Test removing selected items
- selectedItemsHolder.clear();
-
- actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be ", 0, actualEmployees.size());
- }
-
- @Test
- public void testSelectionChangeListener() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- buildEmployeeListHolder(),
- buildEmployeeHolder(),
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- Collection<Employee> employees = new ArrayList<Employee>();
- tableModel.addSelectionChangeListener(buildSelectionChangeListener(employees));
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Test adding selected items
- table.setSelection(new int[] { 0, 2 });
-
- // It seems a manual selection doesn't send any selection event
- tableModel.tableSelectionChanged(null);
-
- Assert.assertNotNull("The collection of selected items can't be null", employees);
- Assert.assertEquals("The count of selected items should be 2", 2, employees.size());
-
- employees.remove(employee1);
- employees.remove(employee3);
- Assert.assertTrue("The selected items was not retrieved correctly", employees.isEmpty());
-
- // Test adding selected items
- employees.add(employee1);
- employees.add(employee3);
- table.deselectAll();
-
- // It seems a manual selection doesn't send any selection event
- tableModel.tableSelectionChanged(null);
-
- Assert.assertNotNull("The collection of selected items can't be null", employees);
- Assert.assertEquals("The count of selected items should be 0", 0, employees.size());
- }
-
- private void testTableItemProperties(Table table,
- int index,
- String expectedName,
- String expectedManager,
- String expectedTitle)
- {
- TableItem tableItem = table.getItem(index);
- Assert.assertNotNull("No TableItem was found for the Employee", tableItem);
-
- String actualName = tableItem.getText(TableColumnAdapter.NAME_COLUMN);
- Assert.assertEquals("TableItem[NAME_COLUMN] was not set correctly", expectedName, actualName);
-
- String actualTitle = tableItem.getText(TableColumnAdapter.TITLE_COLUMN);
- Assert.assertEquals("TableItem[TITLE_COLUMN] was not set correctly", expectedTitle, actualTitle);
-
- String actualManager = tableItem.getText(TableColumnAdapter.MANAGER_COLUMN);
- Assert.assertEquals("TableItem[MANAGER_COLUMN] was not set correctly", expectedManager, actualManager);
- }
-
- private class Employee extends AbstractModel {
-
- private String manager;
- private String name;
- private String title;
-
- static final String MANAGER_PROPERTY = "manager";
- static final String NAME_PROPERTY = "name";
- static final String TITLE_PROPERTY = "title";
-
- Employee(String name, String title, String manager) {
- super();
-
- this.name = name;
- this.title = title;
- this.manager = manager;
- }
-
- String getManager() {
- return manager;
- }
-
- String getName() {
- return name;
- }
-
- String getTitle() {
- return title;
- }
-
- void setManager(String manager) {
- String oldManager = this.manager;
- this.manager = manager;
- firePropertyChanged(MANAGER_PROPERTY, oldManager, manager);
- }
-
- void setName(String name) {
- String oldName = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, oldName, name);
- }
-
- void setTitle(String title) {
- String oldTitle = this.title;
- this.title = title;
- firePropertyChanged(TITLE_PROPERTY, oldTitle, title);
- }
- }
-
- private class Manager extends AbstractModel {
-
- private List<Employee> employees;
-
- static final String EMPLOYEES_LIST = "employees";
-
- Manager() {
- super();
- employees = new ArrayList<Employee>();
- }
-
- Employee addEmployee(Employee employee) {
- addItemToList(employee, employees, EMPLOYEES_LIST);
- return employee;
- }
-
- Employee addEmployee(String name, String title, String manager) {
- Employee employee = new Employee(name, title, manager);
- return addEmployee(employee);
- }
-
- void changeEmployees(List<Employee> employees) {
- this.employees.clear();
- this.employees.addAll(employees);
- fireListChanged(EMPLOYEES_LIST);
- }
-
- ListIterator<Employee> employees() {
- return new CloneListIterator<Employee>(employees);
- }
-
- int employeesSize() {
- return employees.size();
- }
-
- void moveEmployeeDown(Employee employee) {
- int index = employees.indexOf(employee);
- moveItemInList(index + 1, index, employees, EMPLOYEES_LIST);
- }
-
- void moveEmployees(Collection<Employee> employees, int targetIndex) {
-
- int sourceIndex = Integer.MAX_VALUE;
-
- for (Employee employee : employees) {
- sourceIndex = Math.min(sourceIndex, this.employees.indexOf(employee));
- }
-
- moveItemsInList(
- targetIndex,
- sourceIndex,
- employees.size(),
- this.employees,
- EMPLOYEES_LIST
- );
- }
-
- void moveEmployeeUp(Employee employee) {
- int index = employees.indexOf(employee);
- moveItemInList(index - 1, index, employees, EMPLOYEES_LIST);
- }
-
- void removeAllEmployees() {
- clearList(employees, EMPLOYEES_LIST);
- }
-
- void removeEmployee(Employee employee) {
- removeItemFromList(employee, employees, EMPLOYEES_LIST);
- }
-
- void removeEmployees(Collection<Employee> employees) {
- removeItemsFromList(employees.iterator(), this.employees, EMPLOYEES_LIST);
- }
-
- void replace(Employee oldEmployee, Employee newEmployee) {
- replaceItemInList(oldEmployee, newEmployee, employees, EMPLOYEES_LIST);
- }
- }
-
- private class TableColumnAdapter implements ColumnAdapter<Employee> {
-
- static final int COLUMN_COUNT = 3;
- static final int MANAGER_COLUMN = 2;
- static final int NAME_COLUMN = 0;
- static final int TITLE_COLUMN = 1;
-
- private WritablePropertyValueModel<String> buildManagerHolder(Employee subject) {
- return new PropertyAspectAdapter<Employee, String>(Employee.MANAGER_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getManager();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setManager(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(Employee subject) {
- return new PropertyAspectAdapter<Employee, String>(Employee.NAME_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildTitleHolder(Employee subject) {
- return new PropertyAspectAdapter<Employee, String>(Employee.TITLE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getTitle();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setTitle(value);
- }
- };
- }
-
- public WritablePropertyValueModel<?>[] cellModels(Employee subject) {
- WritablePropertyValueModel<?>[] holders = new WritablePropertyValueModel<?>[3];
- holders[NAME_COLUMN] = buildNameHolder(subject);
- holders[TITLE_COLUMN] = buildTitleHolder(subject);
- holders[MANAGER_COLUMN] = buildManagerHolder(subject);
- return holders;
- }
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
- return String.valueOf(columnIndex);
- }
- }
-
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- Employee employee = (Employee) element;
-
- if (columnIndex == TableColumnAdapter.NAME_COLUMN) {
- return employee.getName();
- }
-
- if (columnIndex == TableColumnAdapter.TITLE_COLUMN) {
- return employee.getTitle();
- }
-
- return employee.getManager();
- }
- }
-
- private class TableModel extends TableModelAdapter<Employee> {
-
- TableModel(ListValueModel<Employee> listHolder,
- CollectionValueModel<Employee> selectedItemsHolder,
- Table table,
- ColumnAdapter<Employee> columnAdapter,
- ITableLabelProvider labelProvider) {
-
- super(listHolder,
- selectedItemsHolder,
- table,
- columnAdapter,
- labelProvider);
- }
-
- TableModel(ListValueModel<Employee> listHolder,
- WritablePropertyValueModel<Employee> selectedItemHolder,
- Table table,
- ColumnAdapter<Employee> columnAdapter,
- ITableLabelProvider labelProvider) {
-
- super(listHolder,
- new PropertyCollectionValueModelAdapter<Employee>(selectedItemHolder),
- table,
- columnAdapter,
- labelProvider);
- }
-
- @Override
- protected int indexOf(Employee item) {
- return super.indexOf(item);
- }
-
- @Override
- protected Collection<Employee> selectedItems() {
- return super.selectedItems();
- }
-
- @Override
- protected void tableSelectionChanged(SelectionEvent event) {
- super.tableSelectionChanged(event);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java
deleted file mode 100644
index 6f812805de..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.TextFieldModelAdapter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Play around with a set of entry fields.
- */
-public class TextFieldModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private static final String DEFAULT_NAME = "Scooby Doo";
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<String> nameHolder;
- private final WritablePropertyValueModel<String> allCapsNameHolder;
-
-
- public static void main(String[] args) throws Exception {
- Window window = new TextFieldModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TextFieldModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(DEFAULT_NAME);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.nameHolder = this.buildNameHolder(this.testModelHolder);
- this.allCapsNameHolder = this.buildAllCapsNameHolder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.name();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildAllCapsNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.name().toUpperCase();
- }
- @Override
- protected void setValue_(String value) {
- // do nothing
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control textFieldPanel = this.buildTextFieldPanel(mainPanel);
- this.buildControlPanel(mainPanel, textFieldPanel);
- return mainPanel;
- }
-
- private Control buildTextFieldPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildNameTextField(panel);
- this.buildReadOnlyNameTextField(panel);
- this.buildAllCapsNameTextField(panel);
-
- return panel;
- }
-
- private void buildNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- TextFieldModelAdapter.adapt(this.nameHolder, textField);
- }
-
- private void buildReadOnlyNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- TextFieldModelAdapter.adapt(this.nameHolder, textField);
- }
-
- private void buildAllCapsNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- TextFieldModelAdapter.adapt(this.allCapsNameHolder, textField);
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildResetNameButton(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildResetNameButton(Composite parent) {
- this.buildResetNameACI().fill(parent);
- }
-
- private ActionContributionItem buildResetNameACI() {
- Action action = new Action("reset name", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.resetName();
- }
- };
- action.setToolTipText("reset name");
- return new ActionContributionItem(action);
- }
-
- void resetName() {
- this.testModel.setName(DEFAULT_NAME);
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("name: " + this.testModel.name());
- }
-
-
- // ********** model class **********
-
- class TestModel extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public TestModel(String name) {
- this.name = name;
- }
- public String name() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
deleted file mode 100644
index 80b8840a85..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.TriStateCheckBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.widgets.DefaultWidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Play around with a set of tri-state check boxes.
- */
-public class TriStateCheckBoxModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<Boolean> flag1Holder;
- private final WritablePropertyValueModel<Boolean> flag2Holder;
- private final WritablePropertyValueModel<Boolean> notFlag2Holder;
-
- public static void main(String[] args) throws Exception {
- Window window = new TriStateCheckBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TriStateCheckBoxModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(Boolean.TRUE, Boolean.FALSE);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isFlag1();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isFlag2();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isNotFlag2();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value);
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control checkBoxPanel = this.buildCheckBoxPanel(mainPanel);
- this.buildControlPanel(mainPanel, checkBoxPanel);
- return mainPanel;
- }
-
- private Control buildCheckBoxPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlag1CheckBox(panel);
- this.buildFlag2CheckBox(panel);
- this.buildNotFlag2CheckBox(panel);
- this.buildUnattachedCheckBox(panel);
-
- return panel;
- }
-
- private void buildFlag1CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "flag 1", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "flag 2", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "next flag 2", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildUnattachedCheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "unattached", DefaultWidgetFactory.instance());
- checkBox.addSelectionListener(this.buildUnattachedSelectionListener());
- }
-
- private SelectionListener buildUnattachedSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- System.out.println("unattached default selected: " + e);
- }
- public void widgetSelected(SelectionEvent e) {
- System.out.println("unattached selected: " + e);
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlipFlag1Button(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildFlipFlag1Button(Composite parent) {
- this.buildFlipFlag1ACI().fill(parent);
- }
-
- private ActionContributionItem buildFlipFlag1ACI() {
- Action action = new Action("next flag 1", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.nextFlag1();
- }
- };
- action.setToolTipText("next flag 1");
- return new ActionContributionItem(action);
- }
-
- void nextFlag1() {
- this.testModel.nextFlag1();
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private Boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private Boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private Boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(Boolean flag1, Boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = this.next(flag2);
- }
- private Boolean next(Boolean b) {
- return (b == null) ? Boolean.TRUE : b.booleanValue() ? Boolean.FALSE : null;
- }
- public Boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(Boolean flag1) {
- Boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public void nextFlag1() {
- this.setFlag1(this.next(this.flag1));
- }
- public Boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(Boolean flag2) {
- Boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = this.next(flag2);
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public void nextFlag2() {
- this.setFlag2(this.next(this.flag2));
- }
- public Boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(Boolean notFlag2) {
- this.setFlag2(this.next(flag2));
- }
- public void nextNotFlag2() {
- this.setNotFlag2(this.next(this.notFlag2));
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java
deleted file mode 100644
index 1309b1e27f..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java
+++ /dev/null
@@ -1,801 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jpt.ui.internal.util.ControlAligner;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlAlignerTest {
-
- private ControlAligner controlAligner;
- private Composite parent;
- private Shell shell;
-
- private Layout buildSpacerLayout() {
- return new Layout() {
- @Override
- protected Point computeSize(Composite composite,
- int widthHint,
- int heightHint,
- boolean flushCache) {
-
- return new Point(widthHint, heightHint);
- }
-
- @Override
- protected void layout(Composite composite, boolean flushCache) {
- GridData data = (GridData) composite.getLayoutData();
- composite.setBounds(0, 0, data.widthHint, data.heightHint);
- }
- };
- }
-
- @Before
- public void setUp() {
-
- controlAligner = new ControlAligner();
-
- shell = new Shell(Display.getCurrent());
- shell.setLayout(new GridLayout(1, false));
-
- parent = new Composite(shell, SWT.NONE);
- parent.setLayout(new GridLayout(1, false));
- parent.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- }
-
- @After
- public void tearDown() {
-
- if (controlAligner != null) {
- controlAligner.dispose();
- controlAligner = null;
- }
-
- if (shell != null) {
- shell.dispose();
- shell = null;
- }
- }
-
- @Test
- public void testAddControl1() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- updateGridData(label);
-
- controlAligner.add(label);
-
- assertEquals(
- "The maximum width should be 0,",
- 0,
- controlAligner.getMaximumWidth()
- );
-
- label.setText("This is a ControlAligner");
-// parent.layout(true, true);
-
- Point size = label.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControl2() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("This is a ControlAligner");
- updateGridData(button);
-
- controlAligner.add(button);
- parent.layout(true, true);
-
- Point size = button.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControl3() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
-// parent.layout(true, true);
-
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControlAligner1() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControlAligner2() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-
- controlAligner.add(controlAligner2);
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test(expected=IllegalArgumentException.class)
- public void testAddControlAlignerToItself() throws Exception {
- controlAligner.add(controlAligner);
- fail("A ControlAligner can't be added to itself");
- }
-
- @Test
- public void testDialog_AddControl1() throws Exception {
-
- final int[] maximumWidth = new int[1];
- final int[] size = new int[1];
-
- TitleAreaDialog dialog = new TitleAreaDialog(SWTUtil.getShell()) {
-
- private Label label;
-
- @Override
- protected Control createDialogArea(Composite parent) {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- label = new Label(pane, SWT.LEFT);
- label.setText("This is a ControlAligner");
- updateGridData(label);
-
- controlAligner.add(label);
-
- return parent;
- }
-
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
- size[0] = label.getSize().x;
- maximumWidth[0] = controlAligner.getMaximumWidth();
- }
- };
-
- dialog.create();
- dialog.close();
-
- assertEquals(
- "The width should be " + size[0] + ",",
- size[0],
- maximumWidth[0]
- );
- }
-
- @Test
- public void testDialog_AddControl2() throws Exception {
-
- final int[] maximumWidth = new int[1];
- final int[] sizes = new int[2];
-
- TitleAreaDialog dialog = new TitleAreaDialog(SWTUtil.getShell()) {
-
- private Button button;
- private Label label;
-
- @Override
- protected Control createDialogArea(Composite parent) {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- label = new Label(pane, SWT.NULL);
- label.setText("This is a ControlAligner");
- updateGridData(label);
-
- controlAligner.add(label);
-
- button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
- controlAligner.add(button);
-
- return parent;
- }
-
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
- sizes[0] = label.getSize().x;
- sizes[1] = button.getSize().x;
- maximumWidth[0] = controlAligner.getMaximumWidth();
- }
- };
-
- dialog.create();
- dialog.close();
-
- int labelSize = sizes[0];
- int buttonSize = sizes[1];
- int max = Math.max(labelSize, buttonSize);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- maximumWidth[0]
- );
- }
-
- @Test
- public void testDispose() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- label.dispose();
-
- Point newButtonSize = button.getSize();
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- newButtonSize.x
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- newButtonSize.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testHierarchyOfControlAligners() throws Exception {
-
- // Aligner1
- // ^
- // |-Aligner2
- // ^
- // |-Aligner3
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
-
- ControlAligner controlAligner3 = new ControlAligner();
- controlAligner2.add(controlAligner3);
-
- // Test 1
- Label label1 = new Label(parent, SWT.NULL);
- label1.setText("This is a label widget");
- parent.layout(true, true);
-
- int labelWidth1 = label1.getSize().x;
- controlAligner3.add(label1);
-
- assertEquals(controlAligner3.getMaximumWidth(), labelWidth1);
- assertEquals(controlAligner2.getMaximumWidth(), labelWidth1);
- assertEquals(controlAligner.getMaximumWidth(), labelWidth1);
-
- // Test 2
- Label label2 = new Label(parent, SWT.NULL);
- label2.setText("ShortLabel");
- controlAligner2.add(label2);
- parent.layout(true);
-
- int newLabelWidth1 = label1.getSize().x;
- int newLabelWidth2 = label2.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
-
- // Test 3
- Label label3 = new Label(parent, SWT.NULL);
- label3.setText("A very long label that takes a lot of horizontal space");
-// parent.layout(true);
- controlAligner.add(label3);
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- int newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
-
- // Make sure all the locked are removed
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label2
- label2.setText("mm");
-// parent.layout(true);
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
-
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label1
- label1.setText("a");
-// parent.layout(true);
-
- Composite parent1 = new Composite(SWTUtil.getShell(), SWT.NULL);
- parent1.setLayout(new GridLayout());
-
- Label tempLabel = new Label(parent1, SWT.NULL);
- tempLabel.setText("a");
-// parent1.layout(true);
-
- int realWidth = tempLabel.getSize().x;
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
- assertFalse(newLabelWidth1 == realWidth);
-
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label1
- label1.setText("Yes another big long long text so that all the labels will have to take the size of this label to make sure ControlAligner works correctly");
-// parent.layout(true);
-
- // Weird: It seems no notification is sent, fire one manually
- Event event = new Event();
- event.widget = label1;
- event.type = SWT.Resize;
- label1.notifyListeners(SWT.Resize, event);
-
- Composite parent2 = new Composite(SWTUtil.getShell(), SWT.NULL);
- parent2.setLayout(new GridLayout());
-
- tempLabel = new Label(parent2, SWT.NULL);
- tempLabel.setText(label1.getText());
- parent2.layout(true);
-
- realWidth = tempLabel.getSize().x;
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(controlAligner.getMaximumWidth(), newLabelWidth1);
- assertEquals(realWidth, newLabelWidth1);
-
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(controlAligner3, "locked"), Boolean.FALSE);
- }
-
- @Test
- public void testRemoveControl1() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("This is a ControlAligner");
- updateGridData(button);
-
- controlAligner.add(button);
- parent.layout(true, true);
-
- Point size = button.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
-
- controlAligner.remove(button);
-
- assertEquals(
- "The width should be 0, ",
- 0,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControl2() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-// parent.layout(true, true);
-
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- controlAligner.remove(label);
-
- Point newButtonSize = button.getSize();
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- newButtonSize.x
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- newButtonSize.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControl4() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Widget 1
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
- controlAligner.add(label);
-
- // Widget 2
- Composite spacer = new Composite(pane, SWT.NULL);
- spacer.setLayout(buildSpacerLayout());
- updateGridData(spacer);
- controlAligner.add(spacer);
-
- // Widget 3
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
- controlAligner.add(button);
-
-// parent.layout(true, true);
-
- // Make sure the 3 widgets have the same width
- Point labelSize = label.getSize();
- Point spacerSize = spacer.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
- max = Math.max(max, spacerSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The spacer's width should be " + max + ",",
- max,
- spacerSize.x
- );
-
- // Remove the label (the widest widget) and make sure the width was
- // correctly calculated
- controlAligner.remove(label);
-
- spacerSize = spacer.getSize();
- buttonSize = button.getSize();
- int max2 = Math.max(spacerSize.x, buttonSize.x);
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- max2
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- max2,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The spacer's width should have been adjusted",
- max2,
- spacerSize.x
- );
- }
-
- @Test
- public void testRemoveControlAligner1() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- // Test 1
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
-
- // Test 2
- controlAligner.remove(label1);
-
- width = label2.getSize().x;
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControlAligner2() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- // Test 1
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
-
- // Test 2
- controlAligner2.remove(label2);
-
- width = label1.getSize().x;
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- private void updateGridData(Control control) {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = false;
- control.setLayoutData(data);
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java
deleted file mode 100644
index 7062cc92f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.ControlEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- Combo combo = new Combo(parent, SWT.BORDER);
-
- new ControlEnabler(booleanHolder, combo);
-
- assertTrue(
- "The Combo should be enabled",
- combo.isEnabled()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The Combo should not be enabled",
- combo.isEnabled()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The Combo should be enabled",
- combo.isEnabled()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The Combo should not be enabled",
- combo.isEnabled()
- );
-
- // Dispose
- combo.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java
deleted file mode 100644
index f43e2bcf63..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.PageBook;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlSwitcherTest {
-
- private PageBook pageBook;
- private Composite pane1;
- private Composite pane2;
- private Composite parent;
-
- private Composite buildPane1() {
-
- if (pane1 == null) {
-
- pane1 = new Composite(pageBook, SWT.NULL);
- pane1.setLayout(new GridLayout(2, false));
-
- Label label = new Label(pane1, SWT.NULL);
- label.setText("&Test2:");
-
- Text text = new Text(pane1, SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Combo combo = new Combo(pane1, SWT.BORDER);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- combo.setLayoutData(data);
- }
-
- return pane1;
- }
-
- private Composite buildPane2() {
-
- if (pane2 == null) {
-
- pane2 = new Composite(pageBook, SWT.NULL);
- pane2.setLayout(new GridLayout(2, false));
-
- Label label = new Label(pane2, SWT.NULL);
- label.setText("&Test1:");
-
- Text text = new Text(pane2, SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
-
- return pane2;
- }
-
- private Transformer<Boolean, Control> buildTransformer() {
- return new Transformer<Boolean, Control>() {
- public Control transform(Boolean value) {
- return (value == null) ? null : (value ? pane1 : pane2);
- }
- };
- }
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
-
- pageBook = new PageBook(parent, SWT.NULL);
- pageBook.setLayoutData(new GridData());
- }
-
- @After
- public void tearDown() {
-
- if (parent != null) {
-
- parent.dispose();
-
- parent = null;
- pageBook = null;
- }
- }
-
- @Test
- public void testSwitch() {
-
- SimplePropertyValueModel<Boolean> switchHolder = new SimplePropertyValueModel<Boolean>();
- Transformer<Boolean, Control> transformer = buildTransformer();
-
- pane1 = buildPane1();
- pane1.setVisible(false);
-
- pane2 = buildPane2();
- pane2.setVisible(false);
-
- new ControlSwitcher(
- switchHolder,
- transformer,
- pageBook
- );
-
- // Test 1
- switchHolder.setValue(true);
- Control control = (Control) ClassTools.fieldValue(pageBook, "currentPage");
-
- assertNotNull(
- "The page book's page shouldn't be null",
- control
- );
-
- assertSame(
- "The current pane should be pane1",
- pane1,
- control
- );
-
- Point pane1Size = pane1.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point pageBookSize = pageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- assertEquals(
- "The width of the PageBook should be the same as the width of pane1",
- pane1Size.x,
- pageBookSize.x
- );
-
- assertEquals(
- "The height of the PageBook should be the same as the height of pane1",
- pane1Size.y,
- pageBookSize.y
- );
-
- // Test 2
- switchHolder.setValue(false);
- control = (Control) ClassTools.fieldValue(pageBook, "currentPage");
-
- assertNotNull(
- "The page book's page shouldn't be null",
- control
- );
-
- assertSame(
- "The current pane should be pane2",
- pane2,
- control
- );
-
- Point pane2Size = pane2.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- pageBookSize = pageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- assertEquals(
- "The width of the PageBook should be the same as the width of pane2",
- pane2Size.x,
- pageBookSize.x
- );
-
- assertEquals(
- "The height of the PageBook should be the same as the height of pane2",
- pane2Size.y,
- pageBookSize.y
- );
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
deleted file mode 100644
index 3eaff35309..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.ControlVisibilityEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlVisibilityEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- Combo combo = new Combo(parent, SWT.BORDER);
-
- new ControlVisibilityEnabler(booleanHolder, combo);
-
- assertTrue(
- "The Combo should be visible",
- combo.isVisible()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The Combo should not be visible",
- combo.isVisible()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The Combo should be visible",
- combo.isVisible()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The Combo should not be visible",
- combo.isVisible()
- );
-
- // Dispose
- combo.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java
deleted file mode 100644
index 81cfb08253..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@SuiteClasses
-({
- ControlAlignerTest.class,
- ControlSwitcherTest.class,
- ControlEnablerTest.class,
- ControlVisibilityEnablerTest.class,
- LabeledButtonTest.class,
- LabeledLabelTest.class,
- LabeledControlUpdaterTest.class,
- PaneEnablerTest.class,
- PaneVisibilityEnablerTest.class,
-})
-@RunWith(Suite.class)
-public final class JptUiUtilTests {
-
- private JptUiUtilTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new JUnit4TestAdapter(JptUiUtilTests.class));
- return suite;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java
deleted file mode 100644
index 8057d1b29d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.ui.internal.util.LabeledButton;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class LabeledButtonTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testLabeledButton1() {
- Button button = new Button(parent, SWT.NULL);
- new LabeledButton(button);
- }
-
- @Test(expected=AssertionFailedException.class)
- public void testLabeledButton2() {
- new LabeledButton(null);
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- labeledButton.setImage(expected);
-
- assertEquals(
- "The Button didn't receive the Image",
- expected,
- button.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- button.dispose();
-
- // This should not fail but simply do nothing
- labeledButton.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- String expected = "This is a test";
- labeledButton.setText(expected);
-
- assertEquals(
- "The Button didn't receive the text",
- expected,
- button.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- button.dispose();
-
- // This should not fail but simply do nothing
- String expected = "This is a test";
- labeledButton.setText(expected);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java
deleted file mode 100644
index bb1385264f..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.LabeledControlUpdater;
-import org.eclipse.jpt.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class LabeledControlUpdaterTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<Image> imageHolder = new SimplePropertyValueModel<Image>();
- new LabeledControlUpdater(labeledLabel, null, imageHolder);
-
- labeledLabel.setImage(expected);
-
- assertEquals(
- "The Label didn't receive the Image",
- expected,
- label.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<Image> imageHolder = new SimplePropertyValueModel<Image>();
- new LabeledControlUpdater(labeledLabel, null, imageHolder);
-
- label.dispose();
- labeledLabel.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
-
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<String> textHolder = new SimplePropertyValueModel<String>();
- new LabeledControlUpdater(labeledLabel, textHolder);
-
- String expected = "This is a test";
- textHolder.setValue(expected);
-
- assertEquals(
- "The Label didn't receive the text",
- expected,
- label.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
-
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<String> textHolder = new SimplePropertyValueModel<String>();
- new LabeledControlUpdater(labeledLabel, textHolder);
-
- label.dispose();
-
- String expected = "This is a test";
- textHolder.setValue(expected);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java
deleted file mode 100644
index 5440d3c21d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class LabeledLabelTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testLabeledButton1() {
- Label label = new Label(parent, SWT.NULL);
- new LabeledLabel(label);
- }
-
- @Test(expected=AssertionFailedException.class)
- public void testLabeledButton2() {
- new LabeledLabel(null);
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- labeledLabel.setImage(expected);
-
- assertEquals(
- "The Label didn't receive the Image",
- expected,
- label.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- label.dispose();
-
- // This should not fail but simply do nothing
- labeledLabel.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- String expected = "This is a test";
- labeledLabel.setText(expected);
-
- assertEquals(
- "The Label didn't receive the text",
- expected,
- label.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- label.dispose();
-
- // This should not fail but simply do nothing
- String expected = "This is a test";
- labeledLabel.setText(expected);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
deleted file mode 100644
index 65daed02c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class PaneEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- DialogPane<Node> pane = new DialogPane<Node>(
- new SimplePropertyValueModel<Node>(),
- parent)
- {
- @Override
- protected void initializeLayout(Composite container) {
- }
- };
-
- pane.populate();
- new PaneEnabler(booleanHolder, pane);
-
- assertTrue(
- "The pane should be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The pane should not be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The pane should be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The pane should not be enabled",
- pane.getControl().isEnabled()
- );
-
- // Dispose
- pane.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
deleted file mode 100644
index d2e9a7b69f..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.PaneVisibilityEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class PaneVisibilityEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- DialogPane<Node> pane = new DialogPane<Node>(
- new SimplePropertyValueModel<Node>(),
- parent)
- {
- @Override
- protected void initializeLayout(Composite container) {
- }
- };
-
- pane.populate();
- new PaneVisibilityEnabler(booleanHolder, pane);
-
- assertTrue(
- "The pane should be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The pane should not be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The pane should be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The pane should not be visible",
- pane.getControl().isVisible()
- );
-
- // Dispose
- pane.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath b/jpa/tests/org.eclipse.jpt.utility.tests/.classpath
deleted file mode 100644
index ef8d91ca94..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
deleted file mode 100644
index c4ba612bad..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.project b/jpa/tests/org.eclipse.jpt.utility.tests/.project
deleted file mode 100644
index aa5271e003..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index f68f9c2597..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:26 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 84b5c4c710..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:58 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index a5a719738e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.utility.tests
-Bundle-Version: 1.3.0
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.junit;bundle-version="[3.0.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.utility.tests.internal;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.iterators;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.listener;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value.prefs;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value.swing;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.node;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/about.html b/jpa/tests/org.eclipse.jpt.utility.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/build.properties b/jpa/tests/org.eclipse.jpt.utility.tests/build.properties
deleted file mode 100644
index ebe9c08ef9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties
deleted file mode 100644
index 9995768587..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Java Persistence API Utility Tests
-providerName = Eclipse.org
-
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java
deleted file mode 100644
index aac17b6044..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java
+++ /dev/null
@@ -1,1680 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package test;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collections;
-import java.util.Stack;
-
-/**
- * Convenience methods related to the java.lang.reflect package.
- * These methods provide shortcuts for manipulating objects via
- * reflection; particularly when dealing with fields and/or methods that
- * are not publicly accessible or are inherited.
- *
- * In most cases, all the exceptions are handled and
- * wrapped in java.lang.RuntimeExceptions; so these methods should
- * be used when you are confident that you will not having any problems
- * using reflection.
- *
- * There are also a number of methods whose names
- * begin with "attempt". These methods will throw a NoSuchMethodException
- * or NoSuchFieldException when appropriate, allowing you to probe
- * for methods that should be present but might not.
- */
-public final class ClassTools {
-
- public static final Class<?>[] ZERO_PARAMETER_TYPES = new Class[0];
- public static final Object[] ZERO_PARAMETERS = new Object[0];
- private static final String CR = StringTools.CR;
-
- public static final char NESTED_CLASS_NAME_SEPARATOR = '$';
-
- public static final char ARRAY_INDICATOR = '[';
- public static final char TYPE_DECLARATION_ARRAY_OPEN = '[';
- public static final char TYPE_DECLARATION_ARRAY_CLOSE = ']';
-
- public static final char REFERENCE_CLASS_CODE = 'L';
- public static final char REFERENCE_CLASS_NAME_DELIMITER = ';';
-
- private static Primitive[] PRIMITIVES; // pseudo-'final' - lazy-initialized
- public static final char BYTE_CODE = 'B';
- public static final char CHAR_CODE = 'C';
- public static final char DOUBLE_CODE = 'D';
- public static final char FLOAT_CODE = 'F';
- public static final char INT_CODE = 'I';
- public static final char LONG_CODE = 'J';
- public static final char SHORT_CODE = 'S';
- public static final char BOOLEAN_CODE = 'Z';
- public static final char VOID_CODE = 'V';
- private static int MAX_PRIMITIVE_CLASS_NAME_LENGTH = -1; // pseudo-'final' - lazy-initialized
- private static int MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = -1; // pseudo-'final' - lazy-initialized
-
- public static final String VOID_CLASS_NAME = void.class.getName();
- public static final String VOID_WRAPPER_CLASS_NAME = java.lang.Void.class.getName();
-
-
- /**
- * Return all the fields for the
- * specified class, including inherited fields.
- * Class#allFields()
- */
- @Deprecated
- public static Field[] allFields(Class<?> javaClass) {
- Stack<Field> stack = new Stack<Field>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- pushDeclaredFields(tempClass, stack);
- }
- Collections.reverse(stack);
- return stack.toArray(new Field[stack.size()]);
- }
-
- /**
- * Return all the methods for the
- * specified class, including inherited methods.
- * Class#allMethods()
- */
- public static Method[] allMethods(Class<?> javaClass) {
- Stack<Method> stack = new Stack<Method>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- pushDeclaredMethods(tempClass, stack);
- }
- Collections.reverse(stack);
- return stack.toArray(new Method[stack.size()]);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Throw an exception if the default constructor is not defined.
- * Class#newInstance() throws NoSuchMethodException
- */
- @Deprecated
- public static <T> T attemptNewInstance(Class<T> javaClass) throws NoSuchMethodException {
- return attemptNewInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Throw an exception if the constructor is not defined.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- try {
- return constructor(javaClass, parameterTypes).newInstance(parameters);
- } catch (InstantiationException ie) {
- throw new RuntimeException(ie + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), ie);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), iae);
- } catch (InvocationTargetException ite) {
- throw new RuntimeException(fullyQualifiedConstructorSignature(javaClass, parameterTypes) + CR + ite.getTargetException(), ite);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Throw an exception if the constructor is not defined.
- * Class#newInstance(Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptNewInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Object#getFieldValue(String fieldName) throws NoSuchFieldException
- */
- public static Object attemptToGetFieldValue(Object object, String fieldName) throws NoSuchFieldException {
- try {
- return field(object, fieldName).get(object);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae);
- }
- }
-
- /**
- * Attempt to get a static field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Class#getStaticFieldValue(String fieldName) throws NoSuchFieldException
- */
- public static Object attemptToGetStaticFieldValue(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
- try {
- return field(javaClass, fieldName).get(null);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae);
- }
- }
-
- /**
- * Convenience method.
- * Attempt to execute a zero-argument method,
- * given the receiver and method name.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName) throws NoSuchMethodException {
- return attemptToExecuteMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptToExecuteMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- return executeMethod(method(receiver, methodName, parameterTypes), receiver, parameters);
- }
-
- /**
- * Attempt to execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * If the executed method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethodWithException(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters)
- throws Throwable, NoSuchMethodException
- {
- return executeMethodWithException(method(receiver, methodName, parameterTypes), receiver, parameters);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a zero-argument static method,
- * given the class and method name.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return attemptToExecuteStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Attempt to execute a static method, given the class,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- return executeStaticMethod(staticMethod(javaClass, methodName, parameterTypes), parameters);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a static method, given the class,
- * method name, parameter type, and parameter.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptToExecuteStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to set a field value, given the
- * containing object, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Object#setFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException
- */
- public static void attemptToSetFieldValue(Object object, String fieldName, Object fieldValue) throws NoSuchFieldException {
- try {
- field(object, fieldName).set(object, fieldValue);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae);
- }
- }
-
- /**
- * Attempt to set a static field value, given the
- * containing class, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Class#setStaticFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException
- */
- public static void attemptToSetStaticFieldValue(Class<?> javaClass, String fieldName, Object fieldValue) throws NoSuchFieldException {
- try {
- field(javaClass, fieldName).set(null, fieldValue);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae);
- }
- }
-
- /**
- * Convenience method.
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor() throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass) throws NoSuchMethodException {
- return constructor(javaClass, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return the constructor for the specified class
- * and formal parameter types.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor(Class<?>[] parameterTypes) throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Constructor<T> constructor = javaClass.getDeclaredConstructor(parameterTypes);
- constructor.setAccessible(true);
- return constructor;
- }
-
- /**
- * Convenience method.
- * Return the constructor for the specified class
- * and formal parameter type.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor(Class<?> parameterType) throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass, Class<?> parameterType) throws NoSuchMethodException {
- return constructor(javaClass, new Class[] {parameterType});
- }
-
- /**
- * Return the declared fields for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- * Class#accessibleDeclaredFields()
- */
- public static Field[] declaredFields(Class<?> javaClass) {
- Field[] fields = javaClass.getDeclaredFields();
- for (Field field : fields) {
- field.setAccessible(true);
- }
- return fields;
- }
-
- /**
- * Return the declared methods for the
- * specified class.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- * Class#accessibleDeclaredMethods()
- */
- public static Method[] declaredMethods(Class<?> javaClass) {
- Method[] methods = javaClass.getDeclaredMethods();
- for (Method method : methods) {
- method.setAccessible(true);
- }
- return methods;
- }
-
- /**
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#defaultConstructor()
- */
- public static <T> Constructor<T> defaultConstructor(Class<T> javaClass) throws NoSuchMethodException {
- return constructor(javaClass);
- }
-
- /**
- * Return a field for the specified class and field name.
- * If the class does not directly
- * define the field, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- */
- public static Field field(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
- Field field = null;
- try {
- field = javaClass.getDeclaredField(fieldName);
- } catch (NoSuchFieldException ex) {
- Class<?> superclass = javaClass.getSuperclass();
- if (superclass == null) {
- throw ex;
- }
- // recurse
- return field(superclass, fieldName);
- }
- field.setAccessible(true);
- return field;
- }
-
- /**
- * Convenience method.
- * Return a field for the specified object and field name.
- * If the object's class does not directly
- * define the field, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- */
- public static Field field(Object object, String fieldName) throws NoSuchFieldException {
- return field(object.getClass(), fieldName);
- }
-
- /*
- * Return a string representation of the specified constructor.
- */
- private static String fullyQualifiedConstructorSignature(Class<?> javaClass, Class<?>[] parameterTypes) {
- return fullyQualifiedMethodSignature(javaClass, null, parameterTypes);
- }
-
- /*
- * Return a string representation of the specified field.
- */
- private static String fullyQualifiedFieldName(Class<?> javaClass, String fieldName) {
- StringBuilder sb = new StringBuilder(200);
- sb.append(javaClass.getName());
- sb.append('.');
- sb.append(fieldName);
- return sb.toString();
- }
-
- /*
- * Return a string representation of the specified field.
- */
- private static String fullyQualifiedFieldName(Object object, String fieldName) {
- return fullyQualifiedFieldName(object.getClass(), fieldName);
- }
-
- /*
- * Return a string representation of the specified method.
- */
- private static String fullyQualifiedMethodSignature(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) {
- StringBuilder sb = new StringBuilder(200);
- sb.append(javaClass.getName());
- // this check allows us to use this code for constructors, where the methodName is null
- if (methodName != null) {
- sb.append('.');
- sb.append(methodName);
- }
- sb.append('(');
- int max = parameterTypes.length - 1;
- if (max != -1) {
- // stop one short of the end of the array
- for (int i = 0; i < max; i++) {
- sb.append(parameterTypes[i].getName());
- sb.append(", ");
- }
- sb.append(parameterTypes[max].getName());
- }
- sb.append(')');
- return sb.toString();
- }
-
- /*
- * Return a string representation of the specified method.
- */
- private static String fullyQualifiedMethodSignature(Object receiver, String methodName, Class<?>[] parameterTypes) {
- return fullyQualifiedMethodSignature(receiver.getClass(), methodName, parameterTypes);
- }
-
- /**
- * Get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Object#getFieldValue(String fieldName)
- */
- public static Object fieldValue(Object object, String fieldName) {
- try {
- return attemptToGetFieldValue(object, fieldName);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe);
- }
- }
-
- /**
- * Get a static field value, given the containing class and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Class#getStaticFieldValue(String fieldName)
- */
- public static Object staticFieldValue(Class<?> javaClass, String fieldName) {
- try {
- return attemptToGetStaticFieldValue(javaClass, fieldName);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe);
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName)
- */
- public static Object executeMethod(Object receiver, String methodName) {
- return executeMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptToExecuteMethod(receiver, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?> parameterType, Object parameter) {
- return executeMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName)
- */
- public static Object executeMethodWithException(Object receiver, String methodName)
- throws Throwable
- {
- return executeMethodWithException(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeMethodWithException(Object receiver, String methodName, Class<?> parameterType, Object parameter)
- throws Throwable
- {
- return executeMethodWithException(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeMethodWithException(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters)
- throws Throwable
- {
- try {
- return attemptToExecuteMethodWithException(receiver, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Execute the specified method with the specified parameters.
- * Return its result.
- * Convert exceptions to RuntimeExceptions.
- */
- public static Object executeMethod(Method method, Object receiver, Object[] parameters) {
- try {
- return method.invoke(receiver, parameters);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + method, iae);
- } catch (InvocationTargetException ite) {
- throw new RuntimeException(method + CR + ite.getTargetException(), ite);
- }
- }
-
- /**
- * Execute the specified method with the specified parameters.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Convert all other exceptions to RuntimeExceptions.
- */
- public static Object executeMethodWithException(Method method, Object receiver, Object[] parameters)
- throws Throwable
- {
- try {
- return method.invoke(receiver, parameters);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + method, iae);
- } catch (InvocationTargetException ite) {
- Throwable cause = ite.getCause();
- if (cause == null) {
- throw new RuntimeException(method.toString(), ite);
- }
- throw cause;
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument static method,
- * given the class and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName) {
- return executeStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Execute a static method, given the class,
- * method name, parameter types, and parameters.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptToExecuteStaticMethod(javaClass, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Convenience method.
- * Execute a static method, given the class,
- * method name, parameter type, and parameter.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object parameter) {
- return executeStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Execute the specified static method with the specified parameters.
- * Return its result.
- * Convert exceptions to RuntimeExceptions.
- */
- public static Object executeStaticMethod(Method method, Object[] parameters) {
- return executeMethod(method, null, parameters);
- }
-
- /**
- * Convenience method.
- * Return a zero-argument method for the specified class
- * and method name. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return method(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return a method for the specified class, method name,
- * and formal parameter types. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Method method = null;
- try {
- method = javaClass.getDeclaredMethod(methodName, parameterTypes);
- } catch (NoSuchMethodException ex) {
- Class<?> superclass = javaClass.getSuperclass();
- if (superclass == null) {
- throw ex;
- }
- // recurse
- return method(superclass, methodName, parameterTypes);
- }
- method.setAccessible(true);
- return method;
- }
-
- /**
- * Convenience method.
- * Return a method for the specified class, method name,
- * and formal parameter type. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName, Class<?> parameterType) throws NoSuchMethodException {
- return method(javaClass, methodName, new Class[] {parameterType});
- }
-
- /**
- * Convenience method.
- * Return a zero-argument method for the specified object
- * and method name. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName) throws NoSuchMethodException {
- return method(object.getClass(), methodName);
- }
-
- /**
- * Convenience method.
- * Return a method for the specified object, method name,
- * and formal parameter types. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- return method(object.getClass(), methodName, parameterTypes);
- }
-
- /**
- * Convenience method.
- * Return a method for the specified object, method name,
- * and formal parameter type. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName, Class<?> parameterType) throws NoSuchMethodException {
- return method(object.getClass(), methodName, parameterType);
- }
-
- /**
- * Convenience method.
- * Return the specified class (without the checked exception).
- */
- public static Class<?> classForName(String className) {
- try {
- return Class.forName(className);
- } catch (ClassNotFoundException ex) {
- throw new RuntimeException(className, ex);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static <T> T newInstance(Class<T> javaClass) {
- return newInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static Object newInstance(String className) throws ClassNotFoundException {
- return newInstance(className, null);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static Object newInstance(String className, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, true, classLoader));
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptNewInstance(javaClass, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), nsme);
- }
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object newInstance(String className, Class<?>[] parameterTypes, Object[] parameters) throws ClassNotFoundException {
- return newInstance(className, parameterTypes, parameters, null);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object newInstance(String className, Class<?>[] parameterTypes, Object[] parameters, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, true, classLoader), parameterTypes, parameters);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?> parameterType, Object parameter) {
- return newInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static Object newInstance(String className, Class<?> parameterType, Object parameter) throws ClassNotFoundException {
- return newInstance(className, parameterType, parameter, null);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static Object newInstance(String className, Class<?> parameterType, Object parameter, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, false, classLoader), parameterType, parameter);
- }
-
- /*
- * Push the declared fields for the specified class
- * onto the top of the stack.
- */
- private static void pushDeclaredFields(Class<?> javaClass, Stack<Field> stack) {
- Field[] fields = declaredFields(javaClass);
- for (int i = fields.length; i-- > 0; ) {
- stack.push(fields[i]);
- }
- }
-
- /*
- * Push the declared methods for the specified class
- * onto the top of the stack.
- */
- private static void pushDeclaredMethods(Class<?> javaClass, Stack<Method> stack) {
- Method[] methods = declaredMethods(javaClass);
- for (int i = methods.length; i-- > 0; ) {
- stack.push(methods[i]);
- }
- }
-
- /**
- * Set a field value, given the containing object, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Object#setFieldValue(String fieldName, Object fieldValue)
- */
- public static void setFieldValue(Object object, String fieldName, Object fieldValue) {
- try {
- attemptToSetFieldValue(object, fieldName, fieldValue);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe);
- }
- }
-
- /**
- * Set a static field value, given the containing class, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Class#setStaticFieldValue(String fieldName, Object fieldValue)
- */
- public static void setStaticFieldValue(Class<?> javaClass, String fieldName, Object fieldValue) {
- try {
- attemptToSetStaticFieldValue(javaClass, fieldName, fieldValue);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe);
- }
- }
-
- /**
- * Return the short name of the object's class.
- * Class#getShortName()
- */
- public static String shortClassNameForObject(Object object) {
- return shortNameFor(object.getClass());
- }
-
- /**
- * Return the short name of the class (e.g. "Object").
- * Class#getShortName()
- */
- public static String shortNameForClassNamed(String className) {
- return className.substring(className.lastIndexOf('.') + 1);
- }
-
- /**
- * Return the short name of the class (e.g. "Object").
- * Class#getShortName()
- */
- public static String shortNameFor(Class<?> javaClass) {
- return shortNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the nested name of the object's class.
- * Class#getNestedName()
- */
- public static String nestedClassNameForObject(Object object) {
- return nestedNameFor(object.getClass());
- }
-
- /**
- * Return the nested name of the class (e.g. "Entry").
- * Class#getNestedName()
- */
- public static String nestedNameForClassNamed(String className) {
- return className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1);
- }
-
- /**
- * Return the nested name of the class (e.g. "Entry").
- * Class#getNestedName()
- */
- public static String nestedNameFor(Class<?> javaClass) {
- return nestedNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the "toString()" name of the object's class.
- */
- public static String toStringClassNameForObject(Object object) {
- return toStringNameFor(object.getClass());
- }
-
- /**
- * Return the "toString()" name of the class.
- * "Member" classes will return only the final name:
- * "com.foo.bar.TopLevelClass$MemberClass$NestedMemberClass"
- * => "NestedMemberClass"
- * "Local" and "anonymous" classes will still return the embedded '$'s:
- * "com.foo.bar.TopLevelClass$1LocalClass"
- * => "TopLevelClass$1LocalClass"
- * "com.foo.bar.TopLevelClass$1"
- * => "TopLevelClass$1"
- */
- public static String toStringNameForClassNamed(String className) {
- return classNamedIsMember(className) ?
- className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1)
- :
- className.substring(className.lastIndexOf('.') + 1);
- }
-
- /**
- * Return the "toString()" name of the class.
- */
- public static String toStringNameFor(Class<?> javaClass) {
- return toStringNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the package name of the class (e.g. "java.lang").
- * Class#getPackageName()
- */
- public static String packageNameFor(Class<?> javaClass) {
- return packageNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the package name of the class (e.g. "java.lang").
- * Class#getPackageName()
- */
- public static String packageNameForClassNamed(String className) {
- int lastPeriod = className.lastIndexOf('.');
- if (lastPeriod == -1) {
- return "";
- }
- return className.substring(0, lastPeriod);
- }
-
- /**
- * Return the short name of the class,
- * followed by its package name (e.g. "Object (java.lang)").
- * Class#getShortNameWithPackage()
- */
- public static String shortNameWithPackage(Class<?> javaClass) {
- StringBuilder sb = new StringBuilder(200);
- sb.append(shortNameFor(javaClass));
- if ( ! javaClass.isPrimitive()) {
- sb.append(" (");
- sb.append(packageNameFor(javaClass));
- sb.append(')');
- }
- return sb.toString();
- }
-
- /**
- * Convenience method.
- * Return a zero-argument, static method for the specified class
- * and method name. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return staticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return a static method for the specified class, method name,
- * and formal parameter types. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Method method = method(javaClass, methodName, parameterTypes);
- if (Modifier.isStatic(method.getModifiers())) {
- return method;
- }
- throw new NoSuchMethodException(fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes));
- }
-
- /**
- * Convenience method.
- * Return a static method for the specified class, method name,
- * and formal parameter type. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName, Class<?> parameterTypes) throws NoSuchMethodException {
- return staticMethod(javaClass, methodName, new Class[] {parameterTypes});
- }
-
- /**
- * Return whether the specified class can be "declared" in code;
- * i.e. it is either a "top-level" class or a "member" class, but it
- * is not an "array" class. This method rolls together all the checks
- * from the other methods for a bit of a performance tweak.
- * Class#isDeclarable()
- */
- public static boolean classNamedIsDeclarable(String className) {
- if (className.charAt(0) == ARRAY_INDICATOR) {
- return false; // it is an "array" class
- }
- int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (index == -1) {
- return true; // it is a "top-level" class
- }
- do {
- // the character immediately after each dollar sign cannot be a digit
- index++;
- if (Character.isDigit(className.charAt(index))) {
- return false;
- }
- index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index);
- } while (index != -1);
- return true;
- }
-
- /**
- * Return whether the specified class is a "top-level" class,
- * as opposed to a "member", "local", or "anonymous" class,
- * using the standard jdk naming conventions (i.e. the class
- * name does NOT contain a '$': "TopLevelClass").
- * Class#isTopLevel()
- */
- public static boolean classNamedIsTopLevel(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- return className.indexOf(NESTED_CLASS_NAME_SEPARATOR) == -1;
- }
-
- /**
- * Return whether the specified class is a "member" class,
- * as opposed to a "top-level", "local", or "anonymous" class,
- * using the standard jdk naming conventions (i.e. the class
- * name contains at least one '$' and all the names between
- * each '$' are legal class names:
- * "TopLevelClass$MemberClass$NestedMemberClass").
- * Class#isMember()
- */
- public static boolean classNamedIsMember(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (index == -1) {
- return false; // it is a "top-level" class
- }
- do {
- // the character immediately after each dollar sign cannot be a digit
- index++;
- if (Character.isDigit(className.charAt(index))) {
- return false;
- }
- index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index);
- } while (index != -1);
- return true;
- }
-
- /**
- * Return whether the specified class is a "local" class,
- * as opposed to a "top-level", "member", or "anonymous" class,
- * using the standard jdk (or Eclipse) naming conventions.
- * In the jdk, the class name ends with '$nnnXXX' where the '$' is
- * followed by a series of numeric digits which are followed by the
- * local class name: "TopLevelClass$1LocalClass".
- * In Eclipse, the class name ends with '$nnn$XXX' where the '$' is
- * followed by a series of numeric digits which are separated from
- * the local class name by another '$': "TopLevelClass$1$LocalClass".
- * Class#isLocal()
- */
- public static boolean classNamedIsLocal(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (dollar == -1) {
- return false;
- }
- if ( ! Character.isDigit(className.charAt(dollar + 1))) {
- return false;
- }
- int len = className.length();
- for (int i = dollar + 2; i < len; i++) {
- if (Character.isJavaIdentifierStart(className.charAt(i))) {
- return true;
- }
- }
- // all the characters past the $ are digits (anonymous)
- return false;
- }
-
- /**
- * Return whether the specified class is an "anonymous" class,
- * as opposed to a "top-level", "member", or "local" class,
- * using the standard jdk naming conventions (i.e. the class
- * name ends with '$nnn' where all the characters past the
- * last '$' are numeric digits: "TopLevelClass$1").
- * Class#isAnonymous()
- */
- public static boolean classNamedIsAnonymous(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (dollar == -1) {
- return false;
- }
- int start = dollar + 1;
- for (int i = className.length(); i-- > start; ) {
- if ( ! Character.isDigit(className.charAt(i))) {
- return false;
- }
- }
- // all the characters past the $ are digits
- return true;
- }
-
- /**
- * Return the "array depth" of the specified class.
- * The depth is the number of dimensions for an array type.
- * Non-array types have a depth of zero.
- * Class#getArrayDepth()
- */
- public static int arrayDepthFor(Class<?> javaClass) {
- int depth = 0;
- while (javaClass.isArray()) {
- depth++;
- javaClass = javaClass.getComponentType();
- }
- return depth;
- }
-
- /**
- * Return the "array depth" of the specified object.
- * The depth is the number of dimensions for an array.
- * Non-arrays have a depth of zero.
- */
- public static int arrayDepthForObject(Object object) {
- return arrayDepthFor(object.getClass());
- }
-
- /**
- * Return the "array depth" of the specified class.
- * The depth is the number of dimensions for an array type.
- * Non-array types have a depth of zero.
- * @see java.lang.Class#getName()
- * Class#getArrayDepth()
- */
- public static int arrayDepthForClassNamed(String className) {
- int depth = 0;
- while (className.charAt(depth) == ARRAY_INDICATOR) {
- depth++;
- }
- return depth;
- }
-
- /**
- * Return whether the specified class is an array type.
- * @see java.lang.Class#getName()
- */
- public static boolean classNamedIsArray(String className) {
- return className.charAt(0) == ARRAY_INDICATOR;
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * A non-array type simply returns itself.
- * Class#getElementType()
- */
- public static Class<?> elementTypeFor(Class<?> javaClass) {
- while (javaClass.isArray()) {
- javaClass = javaClass.getComponentType();
- }
- return javaClass;
- }
-
- /**
- * Return the "element type" of the specified object.
- * The element type is the base type held by an array.
- * A non-array simply returns its class.
- */
- public static Class<?> elementTypeForObject(Object object) {
- return elementTypeFor(object.getClass());
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * Non-array types simply return themselves.
- * Class#getElementType()
- */
- public static String elementTypeNameFor(Class<?> javaClass) {
- return elementTypeFor(javaClass).getName();
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * Non-array types simply return themselves.
- * @see java.lang.Class#getName()
- * Class#getElementType()
- */
- public static String elementTypeNameForClassNamed(String className) {
- int depth = arrayDepthForClassNamed(className);
- if (depth == 0) {
- // the name is in the form: "java.lang.Object" or "int"
- return className;
- }
- int last = className.length() - 1;
- if (className.charAt(depth) == REFERENCE_CLASS_CODE) {
- // the name is in the form: "[[[Ljava.lang.Object;"
- return className.substring(depth + 1, last); // drop the trailing ';'
- }
- // the name is in the form: "[[[I"
- return classNameForCode(className.charAt(last));
- }
-
- /**
- * Return whether the specified class is a "reference"
- * class (i.e. neither 'void' nor one of the primitive variable classes,
- * ['boolean', 'int', 'float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsReference(String className) {
- return ! classNamedIsPrimitive(className);
- }
-
- /**
- * Return whether the specified class is a primitive
- * class (i.e. 'void' or one of the primitive variable classes,
- * ['boolean', 'int', 'float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsPrimitive(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsVariablePrimitive(String className) {
- return classNamedIsPrimitive(className)
- && ( ! className.equals(VOID_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. 'java.lang.Void' or one of the primitive variable wrapper classes,
- * ['java.lang.Boolean', 'java.lang.Integer', 'java.lang.Float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsPrimitiveWrapperClass(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveWrapperClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].wrapperClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsVariablePrimitiveWrapperClass(String className) {
- return classNamedIsPrimitiveWrapperClass(className)
- && ( ! className.equals(VOID_WRAPPER_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. 'java.lang.Void' or one of the primitive variable wrapper classes,
- * ['java.lang.Boolean', 'java.lang.Integer', 'java.lang.Float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classIsPrimitiveWrapperClass(Class<?> javaClass) {
- if (javaClass.isArray() || (javaClass.getName().length() > maxPrimitiveWrapperClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].wrapperClass == javaClass) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classIsVariablePrimitiveWrapperClass(Class<?> javaClass) {
- return classIsPrimitiveWrapperClass(javaClass)
- && (javaClass != java.lang.Void.class);
- }
-
- /**
- * Return the class name for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static String classNameForCode(char classCode) {
- return classForCode(classCode).getName();
- }
-
- /**
- * Return the class name for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static String classNameForCode(int classCode) {
- return classNameForCode((char) classCode);
- }
-
- /**
- * Return the class for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> classForCode(char classCode) {
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].code == classCode) {
- return codes[i].javaClass;
- }
- }
- throw new IllegalArgumentException(String.valueOf(classCode));
- }
-
- /**
- * Return the class for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> classForCode(int classCode) {
- return classForCode((char) classCode);
- }
-
- /**
- * Return the class code for the specified class.
- * @see java.lang.Class#getName()
- */
- public static char codeForClass(Class<?> javaClass) {
- if (( ! javaClass.isArray()) && (javaClass.getName().length() <= maxPrimitiveClassNameLength())) {
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass == javaClass) {
- return codes[i].code;
- }
- }
- }
- throw new IllegalArgumentException(javaClass.getName());
- }
-
- /**
- * Return the class code for the specified class.
- * @see java.lang.Class#getName()
- */
- public static char codeForClassNamed(String className) {
- if (( ! classNamedIsArray(className)) && (className.length() <= maxPrimitiveClassNameLength())) {
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return codes[i].code;
- }
- }
- }
- throw new IllegalArgumentException(className);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String typeDeclaration) throws ClassNotFoundException {
- return classForTypeDeclaration(typeDeclaration, ClassTools.class.getClassLoader());
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> classForTypeDeclaration(String typeDeclaration, ClassLoader classLoader) throws ClassNotFoundException {
- TypeDeclaration td = typeDeclaration(typeDeclaration);
- return classForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- private static TypeDeclaration typeDeclaration(String typeDeclaration) {
- typeDeclaration = StringTools.removeAllWhitespace(typeDeclaration);
- int arrayDepth = arrayDepthForTypeDeclaration_(typeDeclaration);
- String elementTypeName = typeDeclaration.substring(0, typeDeclaration.length() - (arrayDepth * 2));
- return new TypeDeclaration(elementTypeName, arrayDepth);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth) throws ClassNotFoundException {
- return classForTypeDeclaration(elementTypeName, arrayDepth, null);
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- // see the "Evaluation" of jdk bug 6446627 for a discussion of loading classes
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth, ClassLoader classLoader) throws ClassNotFoundException {
- // primitives cannot be loaded via Class#forName(),
- // so check for a primitive class name first
- Primitive pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(elementTypeName)) {
- pcc = codes[i];
- break;
- }
- }
- }
-
- // non-array
- if (arrayDepth == 0) {
- return (pcc == null) ? Class.forName(elementTypeName, false, classLoader) : pcc.javaClass;
- }
-
- // array
- StringBuilder sb = new StringBuilder(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
- if (pcc == null) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(elementTypeName);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- } else {
- sb.append(pcc.code);
- }
- return Class.forName(sb.toString(), false, classLoader);
- }
-
- /**
- * Return the class name for the specified "type declaration"; e.g.
- * "int[]" -> "[I"
- * @see java.lang.Class#getName()
- */
- public static String classNameForTypeDeclaration(String typeDeclaration) {
- TypeDeclaration td = typeDeclaration(typeDeclaration);
- return classNameForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- /**
- * Return the array depth for the specified "type declaration"; e.g.
- * "int[]" -> 1
- */
- public static int arrayDepthForTypeDeclaration(String typeDeclaration) {
- return arrayDepthForTypeDeclaration_(StringTools.removeAllWhitespace(typeDeclaration));
- }
-
- /*
- * Assume no whitespace in the type declaration.
- */
- private static int arrayDepthForTypeDeclaration_(String typeDeclaration) {
- int last = typeDeclaration.length() - 1;
- int depth = 0;
- int close = last;
- while (typeDeclaration.charAt(close) == TYPE_DECLARATION_ARRAY_CLOSE) {
- if (typeDeclaration.charAt(close - 1) == TYPE_DECLARATION_ARRAY_OPEN) {
- depth++;
- } else {
- throw new IllegalArgumentException("invalid type declaration: " + typeDeclaration);
- }
- close = last - (depth * 2);
- }
- return depth;
- }
-
- /**
- * Return the class name for the specified "type declaration".
- * @see java.lang.Class#getName()
- */
- public static String classNameForTypeDeclaration(String elementTypeName, int arrayDepth) {
- // non-array
- if (arrayDepth == 0) {
- return elementTypeName;
- }
-
- if (elementTypeName.equals(VOID_CLASS_NAME)) {
- throw new IllegalArgumentException("'" + VOID_CLASS_NAME + "' must have an array depth of zero: " + arrayDepth + '.');
- }
- // array
- StringBuilder sb = new StringBuilder(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
-
- // look for a primitive first
- Primitive pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(elementTypeName)) {
- pcc = codes[i];
- break;
- }
- }
- }
-
- if (pcc == null) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(elementTypeName);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- } else {
- sb.append(pcc.code);
- }
-
- return sb.toString();
- }
-
- private static int maxPrimitiveClassNameLength() {
- if (MAX_PRIMITIVE_CLASS_NAME_LENGTH == -1) {
- MAX_PRIMITIVE_CLASS_NAME_LENGTH = calculateMaxPrimitiveClassNameLength();
- }
- return MAX_PRIMITIVE_CLASS_NAME_LENGTH;
- }
-
- private static int calculateMaxPrimitiveClassNameLength() {
- int max = -1;
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].javaClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static int maxPrimitiveWrapperClassNameLength() {
- if (MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH == -1) {
- MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = calculateMaxPrimitiveWrapperClassNameLength();
- }
- return MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH;
- }
-
- private static int calculateMaxPrimitiveWrapperClassNameLength() {
- int max = -1;
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].wrapperClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static Primitive[] primitives() {
- if (PRIMITIVES == null) {
- PRIMITIVES = buildPrimitives();
- }
- return PRIMITIVES;
- }
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- private static Primitive[] buildPrimitives() {
- Primitive[] result = new Primitive[9];
- result[0] = new Primitive(BYTE_CODE, java.lang.Byte.class);
- result[1] = new Primitive(CHAR_CODE, java.lang.Character.class);
- result[2] = new Primitive(DOUBLE_CODE, java.lang.Double.class);
- result[3] = new Primitive(FLOAT_CODE, java.lang.Float.class);
- result[4] = new Primitive(INT_CODE, java.lang.Integer.class);
- result[5] = new Primitive(LONG_CODE, java.lang.Long.class);
- result[6] = new Primitive(SHORT_CODE, java.lang.Short.class);
- result[7] = new Primitive(BOOLEAN_CODE, java.lang.Boolean.class);
- result[8] = new Primitive(VOID_CODE, java.lang.Void.class);
- return result;
- }
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ClassTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member classes **********
-
- private static class Primitive {
- final char code;
- final Class<?> javaClass;
- final Class<?> wrapperClass;
- private static final String WRAPPER_CLASS_TYPE_FIELD_NAME = "TYPE";
- // e.g. java.lang.Boolean.TYPE => boolean.class
- Primitive(char code, Class<?> wrapperClass) {
- this.code = code;
- this.wrapperClass = wrapperClass;
- this.javaClass = (Class<?>) staticFieldValue(wrapperClass, WRAPPER_CLASS_TYPE_FIELD_NAME);
- }
- }
-
- private static class TypeDeclaration {
- final String elementTypeName;
- final int arrayDepth;
- TypeDeclaration(String elementTypeName, int arrayDepth) {
- this.elementTypeName = elementTypeName;
- this.arrayDepth = arrayDepth;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
deleted file mode 100644
index 8f2e9b8492..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.BitTools;
-
-public class BitToolsTests extends TestCase {
-
- public BitToolsTests(String name) {
- super(name);
- }
-
- public void testFlagIsSetIntInt() {
- assertTrue(BitTools.flagIsSet(0x0003, 0x0001));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0001));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0101));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0103));
-
- assertFalse(BitTools.flagIsSet(0x0303, 0x1103));
- assertFalse(BitTools.flagIsSet(0x0000, 0x1103));
- }
-
- public void testFlagIsOffIntInt() {
- assertFalse(BitTools.flagIsOff(0x0003, 0x0001));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0001));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0101));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0103));
-
- assertTrue(BitTools.flagIsOff(0x2204, 0x1103));
- assertTrue(BitTools.flagIsOff(0x0000, 0x1103));
- }
-
- public void testOnlyFlagIsSetIntInt() {
- assertFalse(BitTools.onlyFlagIsSet(0x0003, 0x0001));
- assertTrue(BitTools.onlyFlagIsSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagIsSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagIsSet(0x0101, 0x0101));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagIsSet(0x0103, 0x0103));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagIsSet(0x1103, 0x1103));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0000, 0x1103));
- assertTrue(BitTools.onlyFlagIsSet(0x0103, 0x0103));
- }
-
- public void testOnlyFlagIsOffIntInt() {
- assertFalse(BitTools.onlyFlagIsOff(0x0003, 0x0001));
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFFFE, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFEFE, 0x0101));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFEFC, 0x0103));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFEEFC, 0x1103));
- }
-
- public void testAllFlagsAreSetIntInt() {
- assertTrue(BitTools.allFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0001));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0101));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0103));
-
- assertFalse(BitTools.allFlagsAreSet(0x0303, 0x1103));
- assertFalse(BitTools.allFlagsAreSet(0x0000, 0x1103));
- }
-
- public void testAllFlagsAreOffIntInt() {
- assertFalse(BitTools.allFlagsAreOff(0x0003, 0x0001));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0001));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0101));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0103));
-
- assertTrue(BitTools.allFlagsAreOff(0x2204, 0x1103));
- assertTrue(BitTools.allFlagsAreOff(0x0000, 0x1103));
- }
-
- public void testOnlyFlagsAreSetIntInt() {
- assertFalse(BitTools.onlyFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagsAreSet(0x0101, 0x0101));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, 0x0103));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagsAreSet(0x1103, 0x1103));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0000, 0x1103));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, 0x0103));
- }
-
- public void testOnlyFlagsAreOffIntInt() {
- assertFalse(BitTools.onlyFlagsAreOff(0x0003, 0x0001));
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFFFE, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFE, 0x0101));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFC, 0x0103));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFEEFC, 0x1103));
- }
-
- public void testAnyFlagsAreSetIntInt() {
- assertTrue(BitTools.anyFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.anyFlagsAreSet(0xFFFF, 0x0001));
- assertTrue(BitTools.anyFlagsAreSet(0x0003, 0xFFFF));
-
- assertFalse(BitTools.anyFlagsAreSet(0x0303, 0x1010));
- assertFalse(BitTools.anyFlagsAreSet(0x0000, 0xFFFF));
- }
-
- public void testAnyFlagsAreOffIntInt() {
- assertTrue(BitTools.anyFlagsAreOff(0x333E, 0x0001));
- assertTrue(BitTools.anyFlagsAreOff(0xFFFE, 0x0001));
- assertTrue(BitTools.anyFlagsAreOff(0x0003, 0xFFFF));
-
- assertFalse(BitTools.anyFlagsAreOff(0x7373, 0x1010));
- assertFalse(BitTools.anyFlagsAreOff(0xFFFF, 0xFFFF));
- }
-
- public void testAllFlagsAreSetIntIntArray() {
- assertTrue(BitTools.allFlagsAreSet(0x0003, new int[] { 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.allFlagsAreSet(0x0303, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- assertFalse(BitTools.allFlagsAreSet(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testAllFlagsAreOffIntIntArray() {
- assertFalse(BitTools.allFlagsAreOff(0x0003, new int[] { 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0100, 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0100, 0x0002, 0x0001 }));
-
- assertTrue(BitTools.allFlagsAreOff(0x0303, new int[] { 0x1000, 0x0400, 0x0020, 0x0000 }));
- assertTrue(BitTools.allFlagsAreOff(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testOnlyFlagsAreSetIntIntArray() {
- assertFalse(BitTools.onlyFlagsAreSet(0x0003, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0101, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x011, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x1103, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0000, new int[] { 0x011, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, new int[] { 0x0101, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testOnlyFlagsAreOffIntIntArray() {
- assertFalse(BitTools.onlyFlagsAreOff(0x0003, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFFFE, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFE, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFC, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFEEFC, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testAnyFlagsAreSetIntIntArray() {
- assertTrue(BitTools.anyFlagsAreSet(0x0003, new int[] { 0x0001 }));
- assertTrue(BitTools.anyFlagsAreSet(0xFFFF, new int[] { 0x0001 }));
- assertTrue(BitTools.anyFlagsAreSet(0x0303, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
-
- assertFalse(BitTools.anyFlagsAreSet(0x0303, new int[] { 0x1000, 0x0010 }));
- assertFalse(BitTools.anyFlagsAreSet(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
- }
-
- public void testAnyFlagsAreOffIntIntArray() {
- assertFalse(BitTools.anyFlagsAreOff(0x0003, new int[] { 0x0001 }));
- assertFalse(BitTools.anyFlagsAreOff(0xFFFF, new int[] { 0x0001 }));
- assertFalse(BitTools.anyFlagsAreOff(0x0303, new int[] { 0x0100, 0x0200, 0x0003, 0x0002 }));
-
- assertTrue(BitTools.anyFlagsAreOff(0x0303, new int[] { 0x0100, 0x0010 }));
- assertTrue(BitTools.anyFlagsAreOff(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
- }
-
- public void testOrFlags() {
- assertEquals(0x0001, BitTools.orFlags(new int[] { 0x0001, 0x0000 }));
- assertEquals(0x0011, BitTools.orFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0xF011, BitTools.orFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- }
-
- public void testAndFlags() {
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0001 }));
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0x0000, BitTools.andFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0011, 0xF001 }));
- }
-
- public void testXorFlags() {
- assertEquals(0x0001, BitTools.xorFlags(new int[] { 0x0001, 0x0000 }));
- assertEquals(0x0010, BitTools.xorFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0xF010, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- assertEquals(0xFF11, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000, 0x0F01 }));
- assertEquals(0xF010, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000, 0x0F01, 0x0F01 }));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java
deleted file mode 100644
index 3e4f266c27..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanHolderTests.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.BooleanHolder;
-
-import junit.framework.TestCase;
-
-public class BooleanHolderTests extends TestCase {
-
- public BooleanHolderTests(String name) {
- super(name);
- }
-
- public void testGetValue() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.getValue());
- }
-
- public void testIsTrue() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.isTrue());
- }
-
- public void testIsFalse() {
- BooleanHolder bh = new BooleanHolder(true);
- assertFalse(bh.isFalse());
- }
-
- public void testIs() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.is(true));
- assertFalse(bh.is(false));
- }
-
- public void testSetValue() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.getValue());
- bh.setValue(false);
- assertFalse(bh.getValue());
- }
-
- public void testSetTrue() {
- BooleanHolder bh = new BooleanHolder(false);
- assertFalse(bh.getValue());
- bh.setTrue();
- assertTrue(bh.getValue());
- }
-
-
- public void testSetFalse() {
- BooleanHolder bh = new BooleanHolder(true);
- assertTrue(bh.getValue());
- bh.setFalse();
- assertFalse(bh.getValue());
- }
-
- public void testClone() {
- BooleanHolder bh = new BooleanHolder(true);
- BooleanHolder clone = (BooleanHolder) bh.clone();
- assertTrue(clone.getValue());
- assertEquals(bh, clone);
- }
-
- public void testEquals() {
- BooleanHolder bh1 = new BooleanHolder(true);
- BooleanHolder bh2 = new BooleanHolder(true);
- assertEquals(bh1, bh2);
-
- BooleanHolder bh3 = new BooleanHolder(false);
- assertFalse(bh1.equals(bh3));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
deleted file mode 100644
index f2e4eae173..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-import java.util.Map.Entry;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class ClassToolsTests extends TestCase {
-
- private static String testStaticField;
-
- public ClassToolsTests(String name) {
- super(name);
- }
-
- /**
- * Return the compiler-generated class name. The Eclipse compiler generates
- * "local" classes with names in the form "com.foo.Outer$1$Local"; while the
- * JDK compiler generates "com.foo.Outer$1Local". There might be other
- * differences.... ~bjv
- */
- public static String compilerDependentClassNameFor(String className) {
- int index = className.indexOf("$1$");
- if (index == -1) {
- return className;
- }
- try {
- Class.forName(className);
- } catch (ClassNotFoundException ex) {
- return className.substring(0, index + 2) + className.substring(index + 3);
- }
- return className;
- }
-
- private static String munge(String className) {
- return compilerDependentClassNameFor(className);
- }
-
- public void testAllFields() {
- int fieldCount = 0;
- fieldCount += java.util.Vector.class.getDeclaredFields().length;
- fieldCount += java.util.AbstractList.class.getDeclaredFields().length;
- fieldCount += java.util.AbstractCollection.class.getDeclaredFields().length;
- fieldCount += java.lang.Object.class.getDeclaredFields().length;
- Field[] fields = ClassTools.allFields(java.util.Vector.class);
- assertEquals(fieldCount, fields.length);
- assertTrue(CollectionTools.contains(this.names(fields), "modCount"));
- assertTrue(CollectionTools.contains(this.names(fields), "serialVersionUID"));
- assertTrue(CollectionTools.contains(this.names(fields), "capacityIncrement"));
- assertTrue(CollectionTools.contains(this.names(fields), "elementCount"));
- assertTrue(CollectionTools.contains(this.names(fields), "elementData"));
- assertTrue(fields[0].isAccessible());
- }
-
- public void testAllMethods() {
- int methodCount = 0;
- methodCount += java.util.Vector.class.getDeclaredMethods().length;
- methodCount += java.util.AbstractList.class.getDeclaredMethods().length;
- methodCount += java.util.AbstractCollection.class.getDeclaredMethods().length;
- methodCount += java.lang.Object.class.getDeclaredMethods().length;
- Method[] methods = ClassTools.allMethods(java.util.Vector.class);
- assertEquals(methodCount, methods.length);
- assertTrue(CollectionTools.contains(this.names(methods), "wait"));
- assertTrue(CollectionTools.contains(this.names(methods), "addElement"));
- assertTrue(methods[0].isAccessible());
- }
-
- public void testNewInstanceClass() {
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class);
- assertNotNull(v);
- assertEquals(0, v.size());
- }
-
- public void testNewInstanceClassClassObject() {
- int initialCapacity = 200;
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class, int.class, new Integer(initialCapacity));
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ClassTools.fieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
- }
-
- public void testNewInstanceClassClassArrayObjectArray() {
- int initialCapacity = 200;
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = int.class;
- Object[] parms = new Object[1];
- parms[0] = new Integer(initialCapacity);
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms);
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ClassTools.fieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- parms[0] = new Integer(-1);
- boolean exCaught = false;
- try {
- v = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms);
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue("RuntimeException not thrown", exCaught);
-
- parmTypes[0] = java.lang.String.class;
- parms[0] = "foo";
- exCaught = false;
- try {
- v = ClassTools.attemptNewInstance(java.util.Vector.class, parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown", exCaught);
- }
-
- public void testFieldValue() {
- int initialCapacity = 200;
- Vector<?> v = new Vector<Object>(initialCapacity);
- Object[] elementData = (Object[]) ClassTools.fieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- // test inherited field
- Integer modCountInteger = (Integer) ClassTools.fieldValue(v, "modCount");
- int modCount = modCountInteger.intValue();
- assertEquals(0, modCount);
-
- boolean exCaught = false;
- Object bogusFieldValue = null;
- try {
- bogusFieldValue = ClassTools.attemptToGetFieldValue(v, "bogusField");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown: " + bogusFieldValue, exCaught);
- }
-
- public void testExecuteMethodObjectString() {
- Vector<String> v = new Vector<String>();
- int size = ((Integer) ClassTools.executeMethod(v, "size")).intValue();
- assertEquals(0, size);
-
- v.addElement("foo");
- size = ((Integer) ClassTools.executeMethod(v, "size")).intValue();
- assertEquals(1, size);
- }
-
- public void testExecuteMethodObjectStringClassObject() {
- Vector<String> v = new Vector<String>();
- boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", Object.class, "foo")).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
- Object voidResult = ClassTools.executeMethod(v, "addElement", Object.class, "bar");
- assertNull(voidResult);
- }
-
- public void testExecuteMethodObjectStringClassArrayObjectArray() {
- Vector<String> v = new Vector<String>();
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = java.lang.Object.class;
- Object[] parms = new Object[1];
- parms[0] = "foo";
- boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", parmTypes, parms)).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- Object bogusMethodReturnValue = null;
- try {
- bogusMethodReturnValue = ClassTools.attemptToExecuteMethod(v, "bogusMethod", parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusMethodReturnValue, exCaught);
- }
-
- public void testExecuteStaticMethodClassString() {
- Double randomObject = (Double) ClassTools.executeStaticMethod(java.lang.Math.class, "random");
- assertNotNull(randomObject);
- double random = randomObject.doubleValue();
- assertTrue(random >= 0);
- assertTrue(random < 1);
- }
-
- public void testExecuteStaticMethodClassStringClassObject() {
- String s = (String) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", boolean.class, Boolean.TRUE);
- assertNotNull(s);
- assertEquals("true", s);
- }
-
- public void testExecuteStaticMethodClassStringClassArrayObjectArray() {
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = boolean.class;
- Object[] parms = new Object[1];
- parms[0] = Boolean.TRUE;
- String s = (String) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", parmTypes, parms);
- assertNotNull(s);
- assertEquals("true", s);
-
- boolean exCaught = false;
- Object bogusStaticMethodReturnValue = null;
- try {
- bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "bogusStaticMethod", parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
-
- // test non-static method
- exCaught = false;
- try {
- bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "toString");
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
- }
-
- public void testSetFieldValue() {
- Vector<String> v = new Vector<String>();
- Object[] newElementData = new Object[5];
- newElementData[0] = "foo";
- ClassTools.setFieldValue(v, "elementData", newElementData);
- ClassTools.setFieldValue(v, "elementCount", new Integer(1));
- // test inherited field
- ClassTools.setFieldValue(v, "modCount", new Integer(1));
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- try {
- ClassTools.attemptToSetFieldValue(v, "bogusField", "foo");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testSetStaticFieldValue() {
- ClassTools.setStaticFieldValue(this.getClass(), "testStaticField", "new value");
- assertEquals(testStaticField, "new value");
-
- boolean exCaught = false;
- try {
- ClassTools.attemptToSetStaticFieldValue(this.getClass(), "bogusStaticField", "new value");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testShortName() {
- assertEquals("Vector", ClassTools.shortClassNameForObject(new java.util.Vector<Object>()));
- assertEquals("Vector", ClassTools.shortNameFor(java.util.Vector.class));
- }
-
- public void testNestedName() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("foo", "bar");
- Entry<String, String> entry = map.entrySet().iterator().next();
- assertEquals("Entry", ClassTools.nestedClassNameForObject(entry));
- assertEquals("Entry", ClassTools.nestedNameFor(java.util.Map.Entry.class));
- }
-
- public void testPackageName() {
- assertEquals("java.util", ClassTools.packageNameFor(java.util.Vector.class));
- assertEquals("java.util", ClassTools.packageNameFor(java.util.Map.Entry.class));
- }
-
- public void testArrayDepthFor() {
- assertEquals(0, ClassTools.arrayDepthFor(java.util.Vector.class));
- assertEquals(0, ClassTools.arrayDepthFor(int.class));
- assertEquals(0, ClassTools.arrayDepthFor(void.class));
- assertEquals(1, ClassTools.arrayDepthFor(java.util.Vector[].class));
- assertEquals(1, ClassTools.arrayDepthFor(int[].class));
- assertEquals(3, ClassTools.arrayDepthFor(java.util.Vector[][][].class));
- assertEquals(3, ClassTools.arrayDepthFor(int[][][].class));
- }
-
- public void testArrayDepthForObject() {
- assertEquals(0, ClassTools.arrayDepthForObject(new java.util.Vector<Object>()));
- assertEquals(1, ClassTools.arrayDepthForObject(new java.util.Vector[0]));
- assertEquals(1, ClassTools.arrayDepthForObject(new int[0]));
- assertEquals(3, ClassTools.arrayDepthForObject(new java.util.Vector[0][0][0]));
- assertEquals(3, ClassTools.arrayDepthForObject(new int[0][0][0]));
- }
-
- public void testArrayDepthForClassNamed() {
- assertEquals(0, ClassTools.arrayDepthForClassNamed(java.util.Vector.class.getName()));
- assertEquals(0, ClassTools.arrayDepthForClassNamed(int.class.getName()));
- assertEquals(0, ClassTools.arrayDepthForClassNamed(void.class.getName()));
- assertEquals(1, ClassTools.arrayDepthForClassNamed(java.util.Vector[].class.getName()));
- assertEquals(1, ClassTools.arrayDepthForClassNamed(int[].class.getName()));
- assertEquals(3, ClassTools.arrayDepthForClassNamed(java.util.Vector[][][].class.getName()));
- assertEquals(3, ClassTools.arrayDepthForClassNamed(int[][][].class.getName()));
- }
-
- public void testElementTypeFor() {
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector.class));
- assertEquals(int.class, ClassTools.elementTypeFor(int.class));
- assertEquals(void.class, ClassTools.elementTypeFor(void.class));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[].class));
- assertEquals(int.class, ClassTools.elementTypeFor(int[].class));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[][][].class));
- assertEquals(int.class, ClassTools.elementTypeFor(int[][][].class));
- }
-
- public void testElementTypeForObject() {
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector<Object>()));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0]));
- assertEquals(int.class, ClassTools.elementTypeForObject(new int[0]));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0][0][0]));
- assertEquals(int.class, ClassTools.elementTypeForObject(new int[0][0][0]));
- }
-
- public void testElementTypeNameFor() {
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector.class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int.class));
- assertEquals(void.class.getName(), ClassTools.elementTypeNameFor(void.class));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[].class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[].class));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[][][].class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[][][].class));
- }
-
- public void testElementTypeNameForClassNamed() {
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector.class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int.class.getName()));
- assertEquals(void.class.getName(), ClassTools.elementTypeNameForClassNamed(void.class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[].class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[].class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[][][].class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[][][].class.getName()));
- }
-
- public void testClassCodes() {
- assertEquals("byte", ClassTools.classNameForCode('B'));
- assertEquals("char", ClassTools.classNameForCode('C'));
- assertEquals("double", ClassTools.classNameForCode('D'));
- assertEquals("float", ClassTools.classNameForCode('F'));
- assertEquals("int", ClassTools.classNameForCode('I'));
- assertEquals("long", ClassTools.classNameForCode('J'));
- assertEquals("short", ClassTools.classNameForCode('S'));
- assertEquals("boolean", ClassTools.classNameForCode('Z'));
- assertEquals("void", ClassTools.classNameForCode('V'));
-
- boolean exCaught = false;
- try {
- ClassTools.classNameForCode('X');
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testClassNamedIsTopLevel() throws Exception {
- assertTrue(ClassTools.classNamedIsTopLevel(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsTopLevel(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsTopLevel(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsTopLevel(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- }
-
- public void testClassNamedIsMember() throws Exception {
- assertFalse(ClassTools.classNamedIsMember(java.util.Map.class.getName())); // top-level
- assertTrue(ClassTools.classNamedIsMember(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsMember(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsMember(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
-
- // test a few edge cases
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1"));
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a1$aaa"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a"));
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a12345$b12345"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$12345a"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$333"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map3$333"));
- }
-
- public void testClassNamedIsLocal() throws Exception {
- class LocalClass {
- void foo() {
- System.getProperty("foo");
- }
- }
- new LocalClass().foo();
- assertFalse(ClassTools.classNamedIsLocal(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsLocal(java.util.Map.Entry.class.getName())); // member
- assertTrue(ClassTools.classNamedIsLocal(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsLocal(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1$aaa$bbb"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$11$aaa"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1$a")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc1")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1a")); // jdk naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc")); // jdk naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc1")); // jdk naming convention
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a12345$b12345"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$12345$a1234"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$333"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map3$333"));
- }
-
- public void testClassNamedIsAnonymous() throws Exception {
- assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsAnonymous(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertTrue(ClassTools.classNamedIsAnonymous(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a1$aaa"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1$a"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a12345$b12345"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$12345$a1234"));
- assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map$333"));
- assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map3$333"));
- }
-
- public void testCodeForClass() {
- assertEquals('I', ClassTools.codeForClass(int.class));
- assertEquals('B', ClassTools.codeForClass(byte.class));
- }
-
- public void testCodeForClassNamed() {
- assertEquals('I', ClassTools.codeForClassNamed(int.class.getName()));
- assertEquals('I', ClassTools.codeForClassNamed("int"));
- assertEquals('B', ClassTools.codeForClassNamed(byte.class.getName()));
- assertEquals('B', ClassTools.codeForClassNamed("byte"));
- }
-
- public void testClassIsPrimitiveWrapperClass() {
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Void.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Boolean.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Integer.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Float.class));
-
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(java.lang.String.class));
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(void.class));
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(int.class));
- }
-
- public void testClassIsVariablePrimitiveWrapperClass() {
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Void.class));
-
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Boolean.class));
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Integer.class));
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Float.class));
-
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.String.class));
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(void.class));
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(int.class));
- }
-
- public void testClassNamedIsPrimitive() {
- assertTrue(void.class.isPrimitive());
-
- assertTrue(ClassTools.classNamedIsPrimitive(void.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(int.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(float.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Boolean.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Integer.class.getName()));
- }
-
- public void testClassNamedIsVariablePrimitive() {
- assertFalse(ClassTools.classNamedIsVariablePrimitive(void.class.getName()));
-
- assertTrue(ClassTools.classNamedIsVariablePrimitive(int.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitive(float.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitive(boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.Boolean.class.getName()));
- }
-
- public void testClassNamedIsVariablePrimitiveWrapperClass() {
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Void.class.getName()));
-
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Integer.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Float.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Object.class.getName()));
- }
-
- public void testClassForTypeDeclarationStringInt() throws Exception {
- assertEquals(int.class, ClassTools.classForTypeDeclaration("int", 0));
- assertEquals(int[].class, ClassTools.classForTypeDeclaration("int", 1));
- assertEquals(int[][][].class, ClassTools.classForTypeDeclaration("int", 3));
-
- assertEquals(Object.class, ClassTools.classForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class, ClassTools.classForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class, ClassTools.classForTypeDeclaration("void", 0));
- try {
- ClassTools.classForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (ClassNotFoundException ex) {
- // expected
- }
- }
-
- public void testClassNameForTypeDeclarationString() throws Exception {
- assertEquals("int", ClassTools.classNameForTypeDeclaration("int"));
- assertEquals("[I", ClassTools.classNameForTypeDeclaration("int[]"));
- assertEquals("[[I", ClassTools.classNameForTypeDeclaration("int [ ] [ ]"));
-
- assertEquals("java.lang.Object", ClassTools.classNameForTypeDeclaration("java.lang.Object"));
- assertEquals("[Ljava.lang.Object;", ClassTools.classNameForTypeDeclaration("java.lang.Object\t[]"));
- assertEquals("[[Ljava.lang.Object;", ClassTools.classNameForTypeDeclaration("java.lang.Object\t[]\t[]"));
- }
-
- public void testArrayDepthForTypeDeclarationString() throws Exception {
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object[]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object[][][]"));
-
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("int"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("int[]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("int[][][]"));
-
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("float"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("float [ ]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("float[] [] []"));
- }
-
- public void testClassNameForTypeDeclarationStringInt() throws Exception {
- assertEquals(int.class.getName(), ClassTools.classNameForTypeDeclaration("int", 0));
- assertEquals(int[].class.getName(), ClassTools.classNameForTypeDeclaration("int", 1));
- assertEquals(int[][][].class.getName(), ClassTools.classNameForTypeDeclaration("int", 3));
-
- assertEquals(Object.class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class.getName(), ClassTools.classNameForTypeDeclaration("void", 0));
- try {
- ClassTools.classNameForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (IllegalArgumentException ex) {
- // expected
- }
- }
-
- private Iterator<String> names(Field[] fields) {
- return new TransformationIterator<Field, String>(CollectionTools.iterator(fields)) {
- @Override
- protected String transform(Field field) {
- return field.getName();
- }
- };
- }
-
- private Iterator<String> names(Method[] methods) {
- return new TransformationIterator<Method, String>(CollectionTools.iterator(methods)) {
- @Override
- protected String transform(Method method) {
- return method.getName();
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
deleted file mode 100644
index 4e19dac30c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Classpath;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class ClasspathTests extends TestCase {
- private static final String JAVA_HOME = System.getProperty("java.home");
-
- public ClasspathTests(String name) {
- super(name);
- }
-
- public void testCompressed() {
- String path = "";
-
- // no changes
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;;C:\\jdk\\jaws.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- // no changes
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\..\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk1\\jdk2\\jdk3\\..\\..\\..\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- }
-
- public void testConvertToClassName() {
- String fileName = "java/lang/String.class";
- File file = new File(fileName);
- String className = Classpath.convertToClassName(file);
- assertEquals(java.lang.String.class.getName(), className);
- }
-
- public void testConvertToClass() throws ClassNotFoundException {
- String fileName = "java/lang/String.class";
- File file = new File(fileName);
- Class<?> javaClass = Classpath.convertToClass(file);
- assertEquals(java.lang.String.class, javaClass);
- }
-
- public void testConvertToArchiveClassFileEntryName() {
- String fileName = Classpath.convertToArchiveClassFileEntryName(java.lang.String.class);
- assertEquals("java/lang/String.class", fileName);
- }
-
- public void testConvertToClassFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToClassFileName(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.class", fileName);
- }
-
- public void testConvertToJavaFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToJavaFileName(java.lang.String.class.getName());
- assertEquals("java" + sc + "lang" + sc + "String.java", fileName);
- }
-
- public void testConvertToURLs() {
- URL[] entries = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).urls();
- int i = 0;
- assertEquals(this.morphURL("/C:/jdk/rt.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/jdk/i18n.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/jdk/jaws.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/foo/classes"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/bar/bar.jar"), entries[i++].getPath());
- assertEquals(i, entries.length);
- }
-
- public void testEntries() {
- Classpath cp = new Classpath(this.morph("C:\\jdk\\rt.jar;;.;C:\\jdk\\i18n.jar;;;C:\\jdk\\jaws.jar;;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\bar\\bar.jar;"));
- Classpath.Entry[] entries = cp.entries();
- int i = 0;
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName());
- assertEquals(this.morph("."), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(i, entries.length);
-
- cp = cp.compressed();
- entries = cp.entries();
- i = 0;
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName());
- assertEquals(this.morph("."), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(i, entries.length);
- }
-
- public void testEntryForFileNamed() {
- Classpath.Entry entry = null;
-
- // in the middle - qualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // in the middle - unqualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;rt.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // at the beginning - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // at the beginning - unqualified
- entry = new Classpath(this.morph("rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // at the end - qualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // at the end - unqualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;rt.jar")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // alone - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // alone - unqualified
- entry = new Classpath("rt.jar").entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // trick entry at the beginning
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // trick entry in the middle
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // trick entry at the end
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // missing
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).entryForFileNamed("rt.jar");
- assertEquals("path entry should not be found", null, entry);
-
- }
-
- public void testLocationForClass() {
- Class<?> javaClass = Classpath.class;
- File entry = new File(Classpath.locationFor(javaClass));
- if (entry.isFile() || entry.isDirectory()) {
- assertTrue(entry.exists());
- }
- if (entry.isDirectory()) {
- assertTrue(new File(entry, Classpath.convertToClassFileName(javaClass)).exists());
- }
- }
-
- public void testRtJarName() throws IOException {
- File rtFile = new File(Classpath.rtJarName());
- assertTrue("rt.jar does not exist", rtFile.exists());
-
- JarFile rtJarFile = new JarFile(rtFile);
- JarEntry entry = rtJarFile.getJarEntry("java/lang/Object.class");
- rtJarFile.close();
- assertTrue("bogus rt.jar", entry != null);
- }
-
- public void testJREClassNames() {
- assertTrue("Vector is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), java.util.Vector.class.getName()));
- assertTrue("File is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), java.io.File.class.getName()));
- }
-
- public void testJavaExtensionDirectoryNames() {
- char sep = File.separatorChar;
- String stdExtDirName = JAVA_HOME + sep + "lib" + sep + "ext";
- assertTrue("standard extension dir name missing: " + stdExtDirName, CollectionTools.contains(Classpath.javaExtensionDirectoryNames(), stdExtDirName));
- }
-
- public void testJavaExtensionDirectories() {
- char sep = File.separatorChar;
- File stdExtDir = new File(JAVA_HOME + sep + "lib" + sep + "ext");
- assertTrue("standard extension dir missing: " + stdExtDir.getParent(), CollectionTools.contains(Classpath.javaExtensionDirectories(), stdExtDir));
- }
-
- //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build)
- //TODO Test should be revised to be compatible with IBM JDK
- // public void testJavaExtensionClasspathEntries() {
- // char sep = File.separatorChar;
- // String jdk = System.getProperty("java.version");
- // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) {
- // Collection jarNames = new ArrayList();
- // Classpath.Entry[] entries = Classpath.javaExtensionClasspath().getEntries();
- // for (int i = 0; i < entries.length; i++) {
- // jarNames.add(entries[i].fileName());
- // }
- // String stdExtJarName = JAVA_HOME + sep + "lib" + sep + "ext" + sep + "dnsns.jar";
- // assertTrue("jdk 1.4.x standard extension jar missing: " + stdExtJarName, jarNames.contains(stdExtJarName));
- // } else {
- // fail("we need to update this test for the current jdk");
- // }
- // }
-
- //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build)
- //TODO Test should be revised to be compatible with IBM JDK
- // public void testJavaExtensionClassNames() {
- // String jdk = System.getProperty("java.version");
- // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) {
- // String className = "sun.net.spi.nameservice.dns.DNSNameService";
- // assertTrue("jdk 1.4.x standard extension class missing: " + className,
- // CollectionTools.contains(Classpath.javaExtensionClasspath().classNames(), className));
- // } else {
- // fail("we need to update this test for the current jdk");
- // }
- // }
-
- public void testJavaClasspathClassNames() {
- String className = this.getClass().getName();
- ClassLoader cl = this.getClass().getClassLoader();
- // make sure we are running under the "normal" class loader;
- // when the tests are executed as an ANT task, they are run under
- // an ANT class loader and the "Java" classpath does not include this class
- if (cl.getClass().getName().startsWith("sun.misc")) {
- assertTrue("class missing: " + className, CollectionTools.contains(Classpath.javaClasspath().classNames(), className));
- }
- }
-
- /**
- * morph the specified path to a platform-independent path
- */
- private String morph(String path) {
- String result = path;
- result = result.replace('\\', File.separatorChar);
- result = result.replace(';', File.pathSeparatorChar);
- if (!CollectionTools.contains(File.listRoots(), new File("C:\\"))) {
- result = result.replaceAll("C:", "");
- }
- return result;
- }
-
- /**
- * morph the specified URL to a platform-independent path
- */
- private String morphURL(String url) {
- String result = url;
- if (!CollectionTools.contains(File.listRoots(), new File("C:\\"))) {
- result = result.replaceAll("/C:", "");
- }
- return result;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
deleted file mode 100644
index a9c4ef3268..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
+++ /dev/null
@@ -1,3881 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.EmptyIterable;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class CollectionToolsTests extends TestCase {
-
- public CollectionToolsTests(String name) {
- super(name);
- }
-
- public void testAddObjectArrayObject_Object() {
- Object[] a = CollectionTools.add(this.buildObjectArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_String() {
- String[] a = CollectionTools.add(this.buildStringArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_EmptyArray() {
- String[] a = new String[0];
- a = CollectionTools.add(a, "twenty");
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[0]);
- }
-
- public void testAddObjectArrayIntObject_Object() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_String() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "X", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_End() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 4, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "c", "d", "X" }, a));
- }
-
- public void testAddObjectArrayIntObject_Zero() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 0, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "X", "a", "b", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_Exception() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- boolean exCaught = false;
- try {
- a = CollectionTools.add(a, 33, "X");
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddCharArrayChar() {
- char[] a = CollectionTools.add(this.buildCharArray(), 'd');
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- }
-
- public void testAddCharArrayChar_Empty() {
- char[] a = new char[0];
- a = CollectionTools.add(a, 'd');
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(Arrays.equals(new char[] { 'd' }, a));
- }
-
- public void testAddCharArrayIntChar() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 2, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'c', 'd' }, a));
- }
-
- public void testAddCharArrayIntChar_Zero() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 0, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'X', 'a', 'b', 'c', 'd' }, a));
- }
-
- public void testAddCharArrayIntChar_End() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 4, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X' }, a));
- }
-
- public void testAddIntArrayInt() {
- int[] a = CollectionTools.add(this.buildIntArray(), 30);
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- }
-
- public void testAddIntArrayInt_Empty() {
- int[] a = new int[0];
- a = CollectionTools.add(a, 30);
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(Arrays.equals(new int[] { 30 }, a));
- }
-
- public void testAddIntArrayIntInt() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 2, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 99, 3, 4 }, a));
- }
-
- public void testAddIntArrayIntInt_Zero() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 0, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 1, 2, 3, 4 }, a));
- }
-
- public void testAddIntArrayIntInt_End() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 4, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99 }, a));
- }
-
- public void testAddAllCollectionIterable_StringModified() {
- List<String> list1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, iterable2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(this.buildStringList2()));
- }
-
- public void testAddAllCollectionIterable_StringUnmodified() {
- Set<String> set1 = this.buildStringSet1();
- Iterable<String> iterable3 = this.buildStringList1(); // same elements as set1
- assertFalse(CollectionTools.addAll(set1, iterable3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(this.buildStringList1()));
- }
-
- public void testAddAllCollectionIterable_ObjectModified() {
- List<Object> list1 = this.buildObjectList1();
- Iterable<String> iterable2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, iterable2));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll((List<String>) iterable2));
- }
-
- public void testAddAllCollectionIterable_ObjectUnmodified() {
- Set<Object> set1 = this.buildObjectSet1();
- Iterable<String> iterable3 = this.buildStringList1(); // same elements as set1
- assertFalse(CollectionTools.addAll(set1, iterable3));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll((List<String>) iterable3));
- }
-
- public void testAddAllCollectionIterable_EmptyIterable() {
- Set<Object> set1 = this.buildObjectSet1();
- assertFalse(CollectionTools.addAll(set1, EmptyIterable.instance()));
- assertEquals(3, set1.size());
- }
-
- public void testAddAllCollectionIterableInt_Modified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- Iterable<String> iterable2 = list2;
- assertTrue(CollectionTools.addAll(list1, iterable2.iterator(), list2.size()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(this.buildStringList2()));
- }
-
- public void testAddAllCollectionIterableInt_Unmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list1 = this.buildStringList1(); // same elements as set1
- Iterable<String> iterable3 = list1;
- assertFalse(CollectionTools.addAll(set1, iterable3.iterator(), list1.size()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(this.buildStringList1()));
- }
-
- public void testAddAllCollectionIterator_StringModified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIterator_StringUnmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIterator_ObjectModified() {
- List<Object> list1 = this.buildObjectList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIterator_ObjectUnmodified() {
- Set<Object> set1 = this.buildObjectSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIterator_EmptyIterator() {
- List<String> list1 = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list1, EmptyIterator.<String>instance()));
- assertEquals(3, list1.size());
- }
-
- public void testAddAllCollectionIteratorInt_Modified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator(), 3));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIteratorInt_Unmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator(), 3));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIteratorInt_EmptyIterator() {
- List<String> list1 = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list1, EmptyIterator.<String>instance(), 0));
- assertEquals(3, list1.size());
- }
-
- public void testAddAllCollectionObjectArray_StringModified() {
- List<String> list = this.buildStringList1();
- String[] a = this.buildStringArray1();
- assertTrue(CollectionTools.addAll(list, a));
- assertEquals(6, list.size());
- assertTrue(list.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray_StringListEmptyArray() {
- List<String> list = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_StringUnmodified() {
- Set<String> set = this.buildStringSet1();
- String[] a = this.buildStringArray1();
- assertFalse(CollectionTools.addAll(set, a));
- assertEquals(3, set.size());
- assertTrue(set.containsAll(CollectionTools.collection(a)));
-
- assertFalse(CollectionTools.addAll(set, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_StringSetEmptyArray() {
- Set<String> set = this.buildStringSet1();
- assertFalse(CollectionTools.addAll(set, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_ObjectModified() {
- List<Object> list = this.buildObjectList1();
- String[] a = this.buildStringArray1();
-
- assertTrue(CollectionTools.addAll(list, a));
- assertEquals(6, list.size());
- assertTrue(list.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray_ObjectUnmodified() {
- String[] a = this.buildStringArray1();
- Set<Object> set = this.buildObjectSet1();
- assertFalse(CollectionTools.addAll(set, a));
- assertEquals(3, set.size());
- assertTrue(set.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllListIntObjectArray() {
- List<String> list = this.buildStringList1();
- CollectionTools.addAll(list, 2, new String[] { "X", "X", "X" });
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntObjectArray_Zero() {
- List<String> list = new ArrayList<String>();
- CollectionTools.addAll(list, 0, new String[] { "X", "X", "X" });
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntObjectArray_EmptyArray() {
- List<String> list = this.buildStringList1();
- CollectionTools.addAll(list, 2, new String[0]);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 2, iterable);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable_Zero() {
- List<String> list = new ArrayList<String>();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 0, iterable);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable_EmptyIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = EmptyIterable.instance();
- CollectionTools.addAll(list, 2, iterable);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 2, iterable, 3);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt_Zero() {
- List<String> list = new ArrayList<String>();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 0, iterable, 3);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt_EmptyIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = EmptyIterable.instance();
- CollectionTools.addAll(list, 2, iterable, 0);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 2, iterator);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator_Zero() {
- List<String> list = new ArrayList<String>();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 0, iterator);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator_EmptyIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = EmptyIterator.instance();
- CollectionTools.addAll(list, 2, iterator);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 2, iterator, 3);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt_Zero() {
- List<String> list = new ArrayList<String>();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 0, iterator, 3);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt_EmptyIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = EmptyIterator.instance();
- CollectionTools.addAll(list, 2, iterator, 0);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllObjectArrayCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_Object() {
- Object[] a = this.buildObjectArray1();
- Collection<String> c = this.buildStringList2();
- Object[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, c);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterable_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, iterable);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, iterable);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterableInt_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, iterable, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, iterable, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, iterable, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 1, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 0, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, 1, iterator);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIteratorInt_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 1, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 0, iterator, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, 1, iterator, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = CollectionTools.addAll(a, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterableInt() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = CollectionTools.addAll(a, iterable, 33);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList1().iterator();
- String[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_Object() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIterator_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, iterator, 0);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayObjectArray_Object() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_String() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = this.buildStringArray2();
- String[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_ObjectString() {
- Object[] a1 = this.buildObjectArray1();
- String[] a2 = this.buildStringArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray1() {
- Object[] a1 = new Object[0];
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray2() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = new Object[0];
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Object() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new Object[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_String() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_ObjectString() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_End() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 4, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d", "X", "X", "X" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Zero() {
- Object[] a = new Object[0];
- a = CollectionTools.addAll(a, 0, new String[] { "X", "X", "X" });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_EmptyArray2() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 4, new String[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_EmptyArray1() {
- Object[] a = new String[0];
- a = CollectionTools.addAll(a, 0, new Object[] { "a", "b", "c", "d" });
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d" }, a));
- }
-
- public void testAddAllCharArrayCharArray() {
- char[] a = CollectionTools.addAll(this.buildCharArray(), new char[] { 'd', 'e' });
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayCharArray_EmptyArray2() {
- char[] a = CollectionTools.addAll(this.buildCharArray(), new char[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllCharArrayCharArrayEmptyArray1() {
- char[] a = CollectionTools.addAll(new char[0], new char[] { 'd', 'e' });
- assertEquals(2, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayIntCharArray() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 2, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'X', 'X', 'c', 'd' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_End() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 4, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X', 'X', 'X' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_EmptyArray1() {
- char[] a = new char[0];
- a = CollectionTools.addAll(a, 0, new char[] { 'X', 'X', 'X' });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'X', 'X', 'X' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_EmptyArray2() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 2, new char[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd' }, a));
- }
-
- public void testAddAllIntArrayIntArray() {
- int[] a = CollectionTools.addAll(this.buildIntArray(), new int[] { 30, 40 });
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray2() {
- int[] a = CollectionTools.addAll(this.buildIntArray(), new int[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray1() {
- int[] a = CollectionTools.addAll(new int[0], new int[] { 30, 40 });
- assertEquals(2, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntIntArray() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 2, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 99, 99, 99, 3, 4 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_End() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 4, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99, 99, 99 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_EmptyArray2() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 2, new int[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_EmptyArray1() {
- int[] a = new int[0];
- a = CollectionTools.addAll(a, 0, new int[] { 99, 99, 99 });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 99, 99 }, a));
- }
-
- public void testArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable, 3);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_String() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = CollectionTools.array(iterable, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_Object() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable, new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = CollectionTools.array(iterable, 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator());
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator_Empty() {
- Object[] a = CollectionTools.array(EmptyIterator.instance());
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorInt() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), 3);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorInt_Empty() {
- Object[] a = CollectionTools.array(EmptyIterator.instance(), 3);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_String() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorObjectArray_Empty() {
- String[] a = CollectionTools.array(EmptyIterator.<String>instance(), new String[0]);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_Object() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray_Empty() {
- String[] a = CollectionTools.array(EmptyIterator.<String>instance(), 3, new String[0]);
- assertEquals(0, a.length);
- }
-
- public void testBagEnumeration_String() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration_Object() {
- Bag<Object> b = CollectionTools.<Object>bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration_Empty() {
- Bag<Object> b = CollectionTools.<Object>bag(EmptyEnumeration.instance());
- assertEquals(0, b.size());
- }
-
- public void testBagEnumerationInt() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements(), 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumerationInt_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyEnumeration.<String>instance(), 3);
- assertEquals(0, b.size());
- }
-
- public void testBagIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Bag<String> b = CollectionTools.bag(iterable);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Bag<String> b = CollectionTools.bag(iterable, 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator_String() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator_StringObject() {
- Collection<String> c = new ArrayList<String>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- Bag<Object> b = CollectionTools.<Object>bag(c.iterator());
- assertEquals(4, b.size());
- assertTrue(b.containsAll(c));
- }
-
- public void testBagIterator_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyIterator.<String>instance());
- assertEquals(0, b.size());
- }
-
- public void testBagIteratorInt() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator(), 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIteratorInt_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyIterator.<String>instance(), 3);
- assertEquals(0, b.size());
- }
-
- public void testBagObjectArray() {
- Bag<String> b = CollectionTools.bag(this.buildStringArray1());
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, this.buildStringArray1()));
- }
-
- public void testBagObjectArray_Vararg() {
- Bag<String> b = CollectionTools.bag("foo", "bar", "baz");
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, new Object[]{"foo", "bar", "baz"}));
- }
-
- public void testBagObjectArray_Empty() {
- Bag<String> b = CollectionTools.bag(Bag.Empty.<String>instance());
- assertEquals(0, b.size());
- }
-
- public void testCollectionEnumeration() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumeration_ObjectString() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumerationInt() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements(), 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Collection<String> c = CollectionTools.collection(iterable);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Collection<String> c = CollectionTools.collection(iterable, 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator_ObjectString() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIteratorInt() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator(), 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionObjectArray() {
- Collection<String> c = CollectionTools.collection(this.buildStringArray1());
- assertEquals(3, c.size());
- assertTrue(CollectionTools.containsAll(c, this.buildStringArray1()));
- }
-
- public void testContainsEnumerationObject_String() {
- Vector<String> v = this.buildStringVector1();
- assertTrue(CollectionTools.contains(v.elements(), "one"));
- assertFalse(CollectionTools.contains(v.elements(), null));
- v.add(null);
- assertTrue(CollectionTools.contains(v.elements(), null));
- }
-
- public void testContainsEnumerationObject_Object() {
- Vector<Object> c = new Vector<Object>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- String one = "one";
- assertTrue(CollectionTools.contains(c.elements(), one));
- assertFalse(CollectionTools.contains(c.elements(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.elements(), null));
- }
-
- public void testContainsIterableObject() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = c;
- assertTrue(CollectionTools.contains(iterable, "one"));
- assertFalse(CollectionTools.contains(iterable, null));
- c.add(null);
- assertTrue(CollectionTools.contains(iterable, null));
- }
-
- public void testContainsIteratorObject_String() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.contains(c.iterator(), "one"));
- assertFalse(CollectionTools.contains(c.iterator(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.iterator(), null));
- }
-
- public void testContainsIteratorObject_Object() {
- Collection<Object> c = new HashBag<Object>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- String one = "one";
- assertTrue(CollectionTools.contains(c.iterator(), one));
- assertFalse(CollectionTools.contains(c.iterator(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.iterator(), null));
- }
-
- public void testContainsObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertTrue(CollectionTools.contains(a, "one"));
- assertFalse(CollectionTools.contains(a, null));
- Object[] a2 = CollectionTools.add(a, null);
- assertTrue(CollectionTools.contains(a2, null));
- }
-
- public void testContainsCharArrayChar() {
- char[] a = this.buildCharArray();
- assertTrue(CollectionTools.contains(a, 'a'));
- assertFalse(CollectionTools.contains(a, 'z'));
- char[] a2 = CollectionTools.add(a, 'z');
- assertTrue(CollectionTools.contains(a2, 'z'));
- }
-
- public void testContainsIntArrayInt() {
- int[] a = this.buildIntArray();
- assertTrue(CollectionTools.contains(a, 10));
- assertFalse(CollectionTools.contains(a, 55));
- int[] a2 = CollectionTools.add(a, 55);
- assertTrue(CollectionTools.contains(a2, 55));
- }
-
- public void testContainsAllCollectionIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), iterable));
- }
-
- public void testContainsAllCollectionIterator_String() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildStringList1().iterator()));
- }
-
- public void testContainsAllCollectionIterator_Object() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("two");
- c2.add("zero");
- c2.add("one");
- assertTrue(CollectionTools.containsAll(c1, c2.iterator()));
- }
-
- public void testContainsAllCollectionObjectArray_StringObject() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildObjectArray1()));
- }
-
- public void testContainsAllCollectionObjectArray() {
- Object[] a = new Object[] { "zero", "one", "two" };
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), a));
- }
-
- public void testContainsAllIterableCollection() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildStringList1()));
- }
-
- public void testContainsAllIterableIntCollection() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildStringList1()));
- }
-
- public void testContainsAllIterableIterable() {
- Iterable<String> iterable1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable1, iterable2));
- }
-
- public void testContainsAllIterableIntIterable() {
- Iterable<String> iterable1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable1, 3, iterable2));
- }
-
- public void testContainsAllIterableIterator() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIterableIntIterator() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIterableObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildObjectArray1()));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(iterable, this.buildObjectArray1()));
- }
-
- public void testContainsAllIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildObjectArray1()));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(iterable, 3, this.buildObjectArray1()));
- }
-
- public void testContainsAllIteratorCollection_StringString() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList2()));
- }
-
- public void testContainsAllIteratorCollection_ObjectString() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
- assertTrue(CollectionTools.containsAll(c1.iterator(), c2));
- }
-
- public void testContainsAllIteratorIntCollection() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 5, this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 5, this.buildStringList2()));
- }
-
- public void testContainsAllIteratorIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), iterable));
- }
-
- public void testContainsAllIteratorIntIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, iterable));
- }
-
- public void testContainsAllIteratorIterator_StringString() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllIteratorIterator_ObjectString() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
- assertTrue(CollectionTools.containsAll(c1.iterator(), c2.iterator()));
- }
-
- public void testContainsAllIteratorIntIterator() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildStringList2().iterator()));
- }
-
- public void testContainsAllIteratorObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray2()));
- }
-
- public void testContainsAllIteratorIntObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildObjectArray2()));
- }
-
- public void testContainsAllObjectArrayCollection() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList2()));
- }
-
- public void testContainsAllObjectArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), iterable));
- }
-
- public void testContainsAllObjectArrayIterator() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllObjectArrayIterator_Empty() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), EmptyIterator.instance()));
- }
-
- public void testContainsAllObjectArrayObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray2()));
- }
-
- public void testContainsAllCharArrayCharArray() {
- assertTrue(CollectionTools.containsAll(this.buildCharArray(), this.buildCharArray()));
- assertFalse(CollectionTools.containsAll(this.buildCharArray(), new char[] { 'x', 'y' }));
- }
-
- public void testContainsAllIntArrayIntArray() {
- assertTrue(CollectionTools.containsAll(this.buildIntArray(), this.buildIntArray()));
- assertFalse(CollectionTools.containsAll(this.buildIntArray(), new int[] { 444, 888 }));
- }
-
- public void testDiffEnd() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = new String("a");
- String b_ = new String("b");
- String c_ = new String("c");
- String d_ = new String("d");
- String e_ = new String("e");
- assertTrue((a != a_) && a.equals(a_));
- assertTrue((b != b_) && b.equals(b_));
- assertTrue((c != c_) && c.equals(c_));
- assertTrue((d != d_) && d.equals(d_));
- assertTrue((e != e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.diffEnd(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
- }
-
- public void testDiffRange() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), CollectionTools.diffRange(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2));
- }
-
- public void testDiffStart() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = new String("a");
- String b_ = new String("b");
- String c_ = new String("c");
- String d_ = new String("d");
- String e_ = new String("e");
- assertTrue((a != a_) && a.equals(a_));
- assertTrue((b != b_) && b.equals(b_));
- assertTrue((c != c_) && c.equals(c_));
- assertTrue((d != d_) && d.equals(d_));
- assertTrue((e != e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c__));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
- }
-
- public void testEqualsIteratorIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("1000");
- list1.add("2000");
- list1.add("3000");
- list1.add("4000");
-
- List<String> list2 = new ArrayList<String>();
- for (int i = 0; i < list1.size(); i++) {
- list2.add(String.valueOf((i + 1) * 1000));
- }
- assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testGetListIteratorInt() {
- List<String> list = this.buildStringList1();
- String o = CollectionTools.get(list.listIterator(), 1);
- assertEquals("one", o);
- list.add(null);
- o = CollectionTools.get(list.listIterator(), list.size() - 1);
- assertNull(o);
-
- boolean exCaught = false;
- try {
- CollectionTools.get(list.listIterator(), list.size());
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testIdenticalObjectArrayObjectArray() {
- Object[] a1 = new Object[4];
- for (int i = 0; i < a1.length; i++) {
- a1[i] = String.valueOf(i * 1000);
- }
-
- Object[] a2 = new Object[a1.length];
- for (int i = 0; i < a2.length; i++) {
- a2[i] = a1[i];
- }
-
- assertTrue(CollectionTools.identical(a1, a2));
- a2[2] = "2000";
- assertFalse(CollectionTools.identical(a1, a2));
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_BothNull() {
- Object[] a1 = null;
- Object[] a2 = null;
- assertTrue(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_OneNull() {
- Object[] a1 = null;
- Object[] a2 = new Object[0];
- assertFalse(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_DifferentLengths() {
- Object[] a1 = new String[] {"foo", "bar"};
- Object[] a2 = new String[] {"foo", "bar", "baz"};
- assertFalse(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalListIteratorListIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- assertTrue(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdenticalListIteratorListIterator_Not() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- list2.remove(0);
- assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertFalse(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdenticalListIteratorListIterator_DifferentSizes() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- list2.remove(3);
- assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertFalse(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdentityDiffEnd() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.identityDiffEnd(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
- }
-
- public void testIdentityDiffRange() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), CollectionTools.identityDiffRange(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.identityDiffRange(array1, array2));
- }
-
- public void testIdentityDiffStart() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(5, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, CollectionTools.identityDiffStart(array1, array2));
- }
-
- public void testIndexOfListIteratorObject_String() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.indexOf(list.listIterator(), "one"));
- }
-
- public void testIndexOfListIteratorObject_Null() {
- List<String> list = this.buildStringList1();
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfListIteratorObject_Object() {
- List<Object> list = new ArrayList<Object>();
- list.add("0");
- list.add("1");
- list.add("2");
- list.add("3");
-
- String one = "1";
- assertEquals(1, CollectionTools.indexOf(list.listIterator(), one));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.indexOf(a, "one"));
- }
-
- public void testIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, null);
- assertEquals(a.length - 1, CollectionTools.indexOf(a, null));
- }
-
- public void testIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, CollectionTools.indexOf(a, 'b'));
- a = CollectionTools.add(a, 'd');
- assertEquals(a.length - 1, CollectionTools.indexOf(a, 'd'));
- }
-
- public void testIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, CollectionTools.indexOf(a, 10));
- a = CollectionTools.add(a, 30);
- assertEquals(a.length - 1, CollectionTools.indexOf(a, 30));
- }
-
- public void testInsertionIndexOfListComparable() {
- List<String> list = Arrays.asList(new String[] { "A", "C", "D" });
- assertEquals(1, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "C", "D" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" });
- assertEquals(4, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" });
- assertEquals(6, CollectionTools.insertionIndexOf(list, "E"));
-
- list = Arrays.asList(new String[] { "B", "B", "B", "C", "D" });
- assertEquals(0, CollectionTools.insertionIndexOf(list, "A"));
-
- list = Arrays.asList(new String[] { "A", "A", "B", "B", "C", "D" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "A"));
- }
-
- public void testInsertionIndexOfListObjectComparator() {
- Comparator<String> c = new ReverseComparator<String>();
- List<String> list = Arrays.asList(new String[] { "D", "C", "A" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "A" });
- assertEquals(3, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" });
- assertEquals(5, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" });
- assertEquals(0, CollectionTools.insertionIndexOf(list, "E", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B" });
- assertEquals(5, CollectionTools.insertionIndexOf(list, "A", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "A", "A" });
- assertEquals(6, CollectionTools.insertionIndexOf(list, "A", c));
- }
-
- public void testInsertionIndexOfObjectArrayComparable() {
- String[] a = new String[] { "A", "C", "D" };
- assertEquals(1, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "C", "D" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(4, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(6, CollectionTools.insertionIndexOf(a, "E"));
-
- a = new String[] { "B", "B", "B", "C", "D" };
- assertEquals(0, CollectionTools.insertionIndexOf(a, "A"));
-
- a = new String[] { "A", "A", "B", "B", "C", "D" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "A"));
- }
-
- public void testInsertionIndexOfObjectArrayObjectComparator() {
- Comparator<String> c = new ReverseComparator<String>();
- String[] a = new String[] { "D", "C", "A" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "A" };
- assertEquals(3, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(5, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(0, CollectionTools.insertionIndexOf(a, "E", c));
-
- a = new String[] { "D", "C", "B", "B", "B" };
- assertEquals(5, CollectionTools.insertionIndexOf(a, "A", c));
-
- a = new String[] { "D", "C", "B", "B", "A", "A" };
- assertEquals(6, CollectionTools.insertionIndexOf(a, "A", c));
- }
-
- public void testIterableIterator() {
- Iterator<Object> emptyIterator = EmptyIterator.instance();
- Iterable<Object> emptyIterable = CollectionTools.iterable(emptyIterator);
-
- assertFalse(emptyIterable.iterator().hasNext());
-
- boolean exceptionThrown = false;
- try {
- emptyIterator = emptyIterable.iterator();
- fail("invalid iterator: " + emptyIterator);
- } catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
- assertTrue("IllegalStateException not thrown.", exceptionThrown);
-
- }
-
- public void testIterableObjectArray() {
- String[] strings = this.buildStringArray1();
- int i = 0;
- for (String string : CollectionTools.iterable(strings)) {
- assertEquals(strings[i++], string);
- }
- }
-
- public void testIteratorObjectArray() {
- String[] a = this.buildStringArray1();
- int i = 0;
- for (Iterator<String> stream = CollectionTools.iterator(a); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testLastIndexOfIteratorObject() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.lastIndexOf(list.listIterator(), "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(list.listIterator(), null));
- }
-
- public void testLastIndexOfIteratorObject_Empty() {
- assertEquals(-1, CollectionTools.lastIndexOf(EmptyIterator.instance(), "foo"));
- }
-
- public void testLastIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.lastIndexOf(a, "one"));
- }
-
- public void testLastIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, null);
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, null));
- }
-
- public void testLastIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, CollectionTools.lastIndexOf(a, 'b'));
- a = CollectionTools.add(a, 'd');
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 'd'));
- }
-
- public void testLastIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, CollectionTools.lastIndexOf(a, 10));
- a = CollectionTools.add(a, 30);
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 30));
- }
-
- public void testListIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(this.buildStringList1(), CollectionTools.list(iterable));
- }
-
- public void testListIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(this.buildStringList1(), CollectionTools.list(iterable, 3));
- }
-
- public void testListIterator_String() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIterator_StringObject() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<Object> list2 = CollectionTools.<Object>list(list1.iterator());
- assertEquals(list1, list2);
- }
-
- public void testListIterator_Empty() {
- assertEquals(0, CollectionTools.list(EmptyIterator.instance()).size());
- }
-
- public void testListIteratorInt() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator(), 3);
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIteratorInt_Empty() {
- assertEquals(0, CollectionTools.list(EmptyIterator.instance(), 5).size());
- }
-
- public void testListObjectArray() {
- List<String> list = CollectionTools.list(this.buildStringArray1());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIteratorObjectArray() {
- String[] a = this.buildStringArray1();
- int i = 0;
- for (ListIterator<String> stream = CollectionTools.listIterator(a); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testListIteratorObjectArrayInt() {
- String[] a = this.buildStringArray1();
- int i = 1;
- for (ListIterator<String> stream = CollectionTools.listIterator(a, 1); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testMaxCharArray() {
- assertEquals('c', CollectionTools.max(this.buildCharArray()));
- }
-
- public void testMaxIntArray() {
- assertEquals(20, CollectionTools.max(this.buildIntArray()));
- }
-
- public void testMinCharArray() {
- assertEquals('a', CollectionTools.min(this.buildCharArray()));
- }
-
- public void testMinIntArray() {
- assertEquals(0, CollectionTools.min(this.buildIntArray()));
- }
-
- public void testMoveObjectArrayIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = CollectionTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result));
-
- result = CollectionTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result));
-
- result = CollectionTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
-
- result = CollectionTools.move(array, 4, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
- }
-
- public void testMoveObjectArrayIntIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = CollectionTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result));
-
- result = CollectionTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result));
-
- result = CollectionTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
-
- result = CollectionTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = CollectionTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result));
-
- result = CollectionTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = CollectionTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = CollectionTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
- }
-
- public void testMoveIntArrayIntInt() {
- int[] array = new int[] { 0, 1, 2, 3, 4, 5 };
-
- int[] result = CollectionTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 1, 3, 4, 2, 5 }, result));
-
- result = CollectionTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 1, 3, 4, 2 }, result));
-
- result = CollectionTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
-
- result = CollectionTools.move(array, 2, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
- }
-
- public void testMoveIntArrayIntIntInt() {
- int[] array = new int[] { 0, 1, 2, 3, 4, 5 };
-
- int[] result = CollectionTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 1, 3, 4, 2, 5 }, result));
-
- result = CollectionTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 1, 3, 4, 2 }, result));
-
- result = CollectionTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
-
- result = CollectionTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = CollectionTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 3, 2, 4, 5, 1 }, result));
-
- result = CollectionTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = CollectionTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = CollectionTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
- }
-
- public void testMoveCharArrayIntInt() {
- char[] array = new char[] { 'a', 'b', 'c', 'd', 'e', 'f' };
-
- char[] result = CollectionTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'd', 'e', 'c', 'f' }, result));
-
- result = CollectionTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'b', 'd', 'e', 'c' }, result));
-
- result = CollectionTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'e', 'b', 'd', 'c' }, result));
-
- result = CollectionTools.move(array, 2, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'e', 'b', 'd', 'c' }, result));
- }
-
- public void testMoveCharArrayIntIntInt() {
- char[] array = new char[] { 'a', 'b', 'b', 'c', 'd', 'e' };
-
- char[] result = CollectionTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'b', 'e' }, result));
-
- result = CollectionTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'b', 'c', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'd', 'b', 'c', 'b' }, result));
-
- result = CollectionTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'c', 'b', 'd', 'e', 'b' }, result));
-
- result = CollectionTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
- }
-
- public void testMoveListIntIntRandomAccess() {
- List<String> list = new ArrayList<String>();
- CollectionTools.addAll(list, new String[] { "0", "1", "2", "3", "4", "5" });
-
- List<String> result = CollectionTools.move(list, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
- }
-
- public void testMoveListIntIntSequentialAccess() {
- List<String> list = new LinkedList<String>();
- CollectionTools.addAll(list, new String[] { "0", "1", "2", "3", "4", "5" });
-
- List<String> result = CollectionTools.move(list, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
- }
-
- public void testMoveListIntIntIntRandomAccess() {
- List<String> list = new ArrayList<String>(Arrays.asList(new String[] { "0", "1", "2", "3", "4", "5" }));
-
- List<String> result = CollectionTools.move(list, 4, 2, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 0);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
- }
-
- public void testMoveListIntIntIntSequentialAccess() {
- List<String> list = new LinkedList<String>(Arrays.asList(new String[] { "0", "1", "2", "3", "4", "5" }));
-
- List<String> result = CollectionTools.move(list, 4, 2, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 0);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
- }
-
- public void testRemoveAllObjectArrayObjectArray() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[] { "E", "B" };
- String[] a3 = CollectionTools.removeAll(a1, a2);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayObjectArray_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.removeAll(a1, a2);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayObjectArray_NoMatches() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[] { "X", "Y", "Z" };
- String[] a3 = CollectionTools.removeAll(a1, a2);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayIterable() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterableInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable, 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable.iterator());
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIteratorInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable.iterator(), 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayCollection_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = new ArrayList<String>();
- String[] a3 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayCollection_NoMatches() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "X", "Y", "Z" });
- String[] a3 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllCharArrayCharArray() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(new char[] { 'A', 'A', 'C', 'C', 'D', 'D', 'F', 'F' }, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_Empty() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[0];
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_NoMatches() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'X', 'Z' };
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(new int[] { 1, 1, 3, 3, 4, 4, 6, 6 }, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_Empty() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[0];
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_NoMatches() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 52, 67 };
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveObjectArrayObject_Object() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, "three");
- a = CollectionTools.add(a, "four");
- a = CollectionTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, "three"));
- a = CollectionTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(CollectionTools.contains(a, "five"));
- }
-
- public void testRemoveObjectArrayObject_String() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.add(a, "three");
- a = CollectionTools.add(a, "four");
- a = CollectionTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, "three"));
- a = CollectionTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(CollectionTools.contains(a, "five"));
- }
-
- public void testRemoveCharArrayChar() {
- char[] a = this.buildCharArray();
- a = CollectionTools.add(a, 'd');
- a = CollectionTools.add(a, 'e');
- a = CollectionTools.add(a, 'f');
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- a = CollectionTools.remove(a, 'd');
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- assertTrue(CollectionTools.contains(a, 'f'));
- }
-
- public void testRemoveIntArrayInt() {
- int[] a = this.buildIntArray();
- a = CollectionTools.add(a, 30);
- a = CollectionTools.add(a, 40);
- a = CollectionTools.add(a, 50);
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- a = CollectionTools.remove(a, 30);
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- assertTrue(CollectionTools.contains(a, 50));
- }
-
- public void testRemoveAllCollectionIterable() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, iterable));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.removeAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterableInt() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, iterable, 3));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.removeAll(c, iterable, 3));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterator_Empty() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildStringList1().iterator()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildStringList2().iterator()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterator_Duplicates() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionIterator_ObjectString() {
- Collection<Object> c = new ArrayList<Object>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionIteratotInt() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator, 2));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionObjectArray_Empty() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildObjectArray1()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildObjectArray2()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionObjectArray_Duplicates() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, a));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, a));
- }
-
- public void testRemoveAllCollectionObjectArray_MoreDuplicates() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("a");
- c.add("d");
- c.add("d");
- c.add("a");
- c.add("c");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, a));
- assertEquals(3, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, a));
- }
-
- public void testRemoveAllOccurrencesCollectionObject() {
- Collection<String> c = this.buildStringList1();
- assertEquals(3, c.size());
- assertFalse(CollectionTools.removeAllOccurrences(c, "three"));
- assertTrue(CollectionTools.removeAllOccurrences(c, "two"));
- assertFalse(CollectionTools.removeAllOccurrences(c, "two"));
- assertEquals(2, c.size());
-
- c.add("five");
- c.add("five");
- c.add("five");
- assertEquals(5, c.size());
- assertTrue(CollectionTools.removeAllOccurrences(c, "five"));
- assertFalse(CollectionTools.removeAllOccurrences(c, "five"));
- assertEquals(2, c.size());
-
- c.add(null);
- c.add(null);
- c.add(null);
- assertEquals(5, c.size());
- assertTrue(CollectionTools.removeAllOccurrences(c, null));
- assertFalse(CollectionTools.removeAllOccurrences(c, null));
- assertEquals(2, c.size());
- }
-
- public void testRemoveAllOccurrencesObjectArrayObject() {
- String[] a = this.buildStringArray1();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, "three");
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, "five");
- a = CollectionTools.add(a, "five");
- a = CollectionTools.add(a, "five");
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, null);
- a = CollectionTools.add(a, null);
- a = CollectionTools.add(a, null);
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'd');
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, 'g');
- a = CollectionTools.add(a, 'g');
- a = CollectionTools.add(a, 'g');
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 55);
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, 77);
- a = CollectionTools.add(a, 77);
- a = CollectionTools.add(a, 77);
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- }
-
- public void testRemoveElementAtIndexObjectArrayInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "A", "D" }, a));
- }
-
- public void testRemoveElementAtIndexCharArrayInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new char[] { 'A', 'B', 'A', 'A', 'D' }, a));
- }
-
- public void testRemoveElementAtIndexIntArrayInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveElementsAtIndexListIntInt() {
- List<String> list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "A", "C", "A", "D" }));
- List<String> removed = CollectionTools.removeElementsAtIndex(list, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "C", "A" }, removed.toArray()));
-
- list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" }));
- removed = CollectionTools.removeElementsAtIndex(list, 3, 3);
- assertTrue(Arrays.equals(new String[] { "A", "B", "C" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "D", "E", "F" }, removed.toArray()));
-
- list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" }));
- removed = CollectionTools.removeElementsAtIndex(list, 0, 3);
- assertTrue(Arrays.equals(new String[] { "D", "E", "F" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "A", "B", "C" }, removed.toArray()));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementsAtIndex(a, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, a));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt_Empty() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementsAtIndex(a, 0, 5);
- assertTrue(Arrays.equals(new char[] { 'D' }, a));
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt_Empty() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt_Empty() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testReplaceAllObjectArrayObjectObject_Object() {
- Object[] a = new Object[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.replaceAll(a, "A", "Z");
- assertTrue(Arrays.equals(new Object[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllObjectArrayObjectObject_String() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.replaceAll(a, "A", "Z");
- assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllObjectArrayObjectObject_Null() {
- String[] a = new String[] { null, "B", null, "C", null, "D" };
- a = CollectionTools.replaceAll(a, null, "Z");
- assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllCharArrayCharChar() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.replaceAll(a, 'A', 'Z');
- assertTrue(Arrays.equals(new char[] { 'Z', 'B', 'Z', 'C', 'Z', 'D' }, a));
- }
-
- public void testReplaceAllIntArrayIntInt() {
- int[] a = new int[] { 0, 1, 0, 7, 0, 99 };
- a = CollectionTools.replaceAll(a, 0, 13);
- assertTrue(Arrays.equals(new int[] { 13, 1, 13, 7, 13, 99 }, a));
- }
-
- public void testRetainAllCollectionIterable() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- iterable = this.buildStringList2();
- assertTrue(CollectionTools.retainAll(c, iterable));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterableInt() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- iterable = this.buildStringList2();
- assertTrue(CollectionTools.retainAll(c, iterable, 7));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterator() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterator_ObjectString() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
-
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
-
- assertFalse(CollectionTools.retainAll(c1, c2.iterator()));
- assertEquals(c2.size(), c1.size());
- assertEquals(c2, c1);
-
- Collection<String> c3 = new ArrayList<String>();
- c3.add("three");
- c3.add("four");
- c3.add("five");
- }
-
- public void testRetainAllCollectionIterator_EmptyIterator() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, EmptyIterator.instance()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIterator_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator(), 8));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator(), 9));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyIterator() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, EmptyIterator.instance(), 0));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator(), 3));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionObjectArray() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildObjectArray1()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildObjectArray2()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionObjectArray_EmptyObjectArray() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, new Object[0]));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionObjectArray_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, new String[] { "foo" }));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllObjectArrayObjectArray() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Object[] a2 = new Object[] { "E", "B", new Integer(7) };
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray1() {
- String[] a1 = new String[0];
- String[] a2 = new String[] { "E", "B", "" };
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray2() {
- String[] a1 = new String[] { "E", "B", "" };
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_BothEmpty() {
- String[] a1 = new String[0];
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterable() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterable)));
- }
-
- public void testRetainAllObjectArrayIterable_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.retainAll(a1, iterable);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterableInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterable, 3)));
- }
-
- public void testRetainAllObjectArrayIterableInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.retainAll(a1, iterable, 3);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterator)));
- }
-
- public void testRetainAllObjectArrayIterator_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = CollectionTools.retainAll(a1, iterator);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIteratorInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterator, 3)));
- }
-
- public void testRetainAllObjectArrayIteratorInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = CollectionTools.retainAll(a1, iterator, 3);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, collection)));
- }
-
- public void testRetainAllObjectArrayCollection_EmptyObjectArray() {
- String[] a1 = new String[0];
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.retainAll(a1, collection);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection_EmptyCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = new ArrayList<String>();
- String[] a3 = CollectionTools.retainAll(a1, collection);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection_All() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" });
- assertTrue(Arrays.equals(a1, CollectionTools.retainAll(a1, collection)));
- }
-
- public void testRetainAllCharArrayCharArray() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(new char[] { 'B', 'B', 'E', 'E' }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray1() {
- char[] a1 = new char[0];
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray2() {
- char[] a1 = new char[] { 'E', 'B' };
- char[] a2 = new char[0];
- assertEquals(0, CollectionTools.retainAll(a1, a2).length);
- }
-
- public void testRetainAllCharArrayCharArray_RetainAll() {
- char[] a1 = new char[] { 'E', 'B', 'E', 'B', 'E', 'B', 'E', 'B', 'E' };
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllIntArrayIntArray() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(new int[] { 2, 2, 5, 5 }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray1() {
- int[] a1 = new int[0];
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray2() {
- int[] a1 = new int[] { 5, 2 };
- int[] a2 = new int[0];
- assertEquals(0, CollectionTools.retainAll(a1, a2).length);
- }
-
- public void testRetainAllIntArrayIntArray_RetainAll() {
- int[] a1 = new int[] { 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5 };
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testReverseObjectArray_Object() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseObjectArray_String() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.reverse(a);
- assertEquals('c', a[0]);
- assertEquals('b', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testReverseIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.reverse(a);
- assertEquals(20, a[0]);
- assertEquals(10, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testReverseListIterable() {
- Iterable<String> iterable = this.buildStringList1();
- List<String> actual = CollectionTools.reverseList(iterable);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- List<String> actual = CollectionTools.reverseList(iterable, 10);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator_String() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator());
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator_Object() {
- List<Object> actual = CollectionTools.<Object>reverseList(this.buildStringList1().iterator());
- List<Object> expected = this.buildObjectList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIteratorInt() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator(), 33);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testRotateObjectArray() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.rotate(a);
- assertEquals("two", a[0]);
- assertEquals("zero", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testRotateObjectArray_Zero() {
- String[] a1 = new String[0];
- String[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArray_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.rotate(a, 2);
- assertEquals("one", a[0]);
- assertEquals("two", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testRotateObjectArrayInt_ZeroDistance() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_Zero() {
- String[] a1 = new String[0];
- String[] a2 = CollectionTools.rotate(a1, 7);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = CollectionTools.rotate(a1, 8);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.rotate(a);
- assertEquals('c', a[0]);
- assertEquals('a', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testRotateCharArray_Zero() {
- char[] a1 = new char[0];
- char[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt() {
- char[] a = this.buildCharArray();
- a = CollectionTools.rotate(a, 2);
- assertEquals('b', a[0]);
- assertEquals('c', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testRotateCharArrayInt_ZeroDistance() {
- char[] a1 = new char[] { 'a', 'b', 'c' };
- char[] a2 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_Zero() {
- char[] a1 = new char[0];
- char[] a2 = CollectionTools.rotate(a1, 2001);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = CollectionTools.rotate(a1, 22);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.rotate(a);
- assertEquals(20, a[0]);
- assertEquals(0, a[1]);
- assertEquals(10, a[2]);
- }
-
- public void testRotateIntArray_Zero() {
- int[] a1 = new int[0];
- int[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt() {
- int[] a = this.buildIntArray();
- a = CollectionTools.rotate(a, 2);
- assertEquals(10, a[0]);
- assertEquals(20, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testRotateIntArrayInt_ZeroDistance() {
- int[] a1 = new int[] { 3, 2, 1 };
- int[] a2 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_Zero() {
- int[] a1 = new int[0];
- int[] a2 = CollectionTools.rotate(a1, 3);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = CollectionTools.rotate(a1, 44);
- assertSame(a1, a2);
- }
-
- public void testSetIterable() {
- Iterable<String> iterable = this.buildStringSet1();
- assertEquals(this.buildStringSet1(), CollectionTools.set(iterable));
- }
-
- public void testSetIterableInt() {
- Iterable<String> iterable = this.buildStringSet1();
- assertEquals(this.buildStringSet1(), CollectionTools.set(iterable, 22));
- }
-
- public void testSetIterator_String() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator()));
- }
-
- public void testSetIterator_Object() {
- Set<String> set1 = new HashSet<String>();
- set1.add("0");
- set1.add("1");
- set1.add("2");
- set1.add("3");
-
- Set<Object> set2 = CollectionTools.<Object>set(set1.iterator());
- assertEquals(set1, set2);
- }
-
- public void testSetIteratorInt() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator(), 3));
- }
-
- public void testSetObjectArray() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().toArray()));
- }
-
- public void testShuffleObjectArray() {
- String[] array1 = this.buildStringArray1();
- String[] array2 = CollectionTools.shuffle(this.buildStringArray1());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testShuffleCharArray() {
- char[] array1 = this.buildCharArray();
- char[] array2 = CollectionTools.shuffle(this.buildCharArray());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testShuffleIntArray() {
- int[] array1 = this.buildIntArray();
- int[] array2 = CollectionTools.shuffle(this.buildIntArray());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testSingletonIterator_String() {
- Iterator<String> stream = CollectionTools.singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator_Object() {
- Iterator<Object> stream = CollectionTools.<Object>singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator_Cast() {
- Iterator<Object> stream = CollectionTools.singletonIterator((Object) "foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSizeIterable() {
- Iterable<Object> iterable = this.buildObjectList1();
- assertEquals(3, CollectionTools.size(iterable));
- }
-
- public void testSizeIterator() {
- assertEquals(3, CollectionTools.size(this.buildObjectList1().iterator()));
- }
-
- public void testSortedSetIterable() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- Iterable<String> iterable = ss1;
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(iterable);
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIterableInt() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- Iterable<String> iterable = ss1;
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(iterable, 5);
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIterator() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildSortedStringSet1().iterator()));
- }
-
- public void testSortedSetIterator_TreeSet() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(ss1.iterator());
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIteratorInt() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildSortedStringSet1().iterator(), 8));
- }
-
- public void testSortedSetObjectArray() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.set(this.buildSortedStringSet1().toArray()));
- }
-
- public void testSubArrayObjectArrayIntInt() {
- String[] array = new String[] {"foo", "bar", "baz", "joo", "jar", "jaz"};
- String[] result = new String[] {"foo", "bar", "baz", "joo"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 0, 4)));
-
- result = new String[] {"jar"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new String[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new String[] {"joo", "jar", "jaz"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- public void testSubArrayIntArrayIntInt() {
- int[] array = new int[] {77, 99, 333, 4, 9090, 42};
- int[] result = new int[] {77, 99, 333, 4};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 0, 4)));
-
- result = new int[] {9090};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new int[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new int[] {4, 9090, 42};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- public void testSubArrayCharArrayIntInt() {
- char[] array = new char[] {'a', 'b', 'c', 'd', 'e', 'f'};
- char[] result = new char[] {'a', 'b', 'c', 'd'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 0, 4)));
-
- result = new char[] {'e'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new char[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new char[] {'d', 'e', 'f'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- public void testSwapObjectArray() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals("zero", a[0]);
- assertEquals("two", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testSwapCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals('a', a[0]);
- assertEquals('c', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testSwapIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals(0, a[0]);
- assertEquals(20, a[1]);
- assertEquals(10, a[2]);
- }
-
- public void testRemoveDuplicateElementsList() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- list = CollectionTools.removeDuplicateElements(list);
- int i = 0;
- assertEquals("zero", list.get(i++));
- assertEquals("one", list.get(i++));
- assertEquals("two", list.get(i++));
- assertEquals(i, list.size());
- }
-
- public void testRemoveDuplicateElementsList_Empty() {
- List<String> list = new ArrayList<String>();
- list = CollectionTools.removeDuplicateElements(list);
- assertEquals(0, list.size());
- }
-
- public void testRemoveDuplicateElementsList_SingleElement() {
- List<String> list = new ArrayList<String>();
- list.add("zero");
- list = CollectionTools.removeDuplicateElements(list);
- assertEquals(1, list.size());
- }
-
- public void testRemoveDuplicateElementsObjectArray() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- String[] array = CollectionTools.removeDuplicateElements(list.toArray(new String[list.size()]));
- int i = 0;
- assertEquals("zero", array[i++]);
- assertEquals("one", array[i++]);
- assertEquals("two", array[i++]);
- assertEquals(i, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_Empty() {
- String[] array = CollectionTools.removeDuplicateElements(new String[0]);
- assertEquals(0, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_SingleElement() {
- String[] array = CollectionTools.removeDuplicateElements(new String[] { "foo" });
- assertEquals(1, array.length);
- }
-
- public void testVectorIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Vector<String> v = CollectionTools.vector(iterable);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Vector<String> v = CollectionTools.vector(iterable, 8);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator_String() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator_Object() {
- Vector<Object> v = CollectionTools.<Object>vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIteratorInt() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator(), 7);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorObjectArray() {
- Vector<String> v = CollectionTools.vector(this.buildStringArray1());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- private Object[] buildObjectArray1() {
- return new Object[] { "zero", "one", "two" };
- }
-
- private String[] buildStringArray1() {
- return new String[] { "zero", "one", "two" };
- }
-
- private char[] buildCharArray() {
- return new char[] { 'a', 'b', 'c' };
- }
-
- private int[] buildIntArray() {
- return new int[] { 0, 10, 20 };
- }
-
- private Object[] buildObjectArray2() {
- return new Object[] { "three", "four", "five" };
- }
-
- private String[] buildStringArray2() {
- return new String[] { "three", "four", "five" };
- }
-
- private Vector<String> buildStringVector1() {
- Vector<String> v = new Vector<String>();
- this.addToCollection1(v);
- return v;
- }
-
- private List<String> buildStringList1() {
- List<String> l = new ArrayList<String>();
- this.addToCollection1(l);
- return l;
- }
-
- private List<Object> buildObjectList1() {
- List<Object> l = new ArrayList<Object>();
- this.addToCollection1(l);
- return l;
- }
-
- private void addToCollection1(Collection<? super String> c) {
- c.add("zero");
- c.add("one");
- c.add("two");
- }
-
- private List<String> buildStringList2() {
- List<String> l = new ArrayList<String>();
- this.addToCollection2(l);
- return l;
- }
-
- private void addToCollection2(Collection<? super String> c) {
- c.add("three");
- c.add("four");
- c.add("five");
- }
-
- private Set<String> buildStringSet1() {
- Set<String> s = new HashSet<String>();
- this.addToCollection1(s);
- return s;
- }
-
- private Set<Object> buildObjectSet1() {
- Set<Object> s = new HashSet<Object>();
- this.addToCollection1(s);
- return s;
- }
-
- private SortedSet<String> buildSortedStringSet1() {
- SortedSet<String> s = new TreeSet<String>();
- this.addToCollection1(s);
- return s;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java
deleted file mode 100644
index 243149c612..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.Counter;
-
-import junit.framework.TestCase;
-
-public class CounterTests extends TestCase {
-
- public CounterTests(String name) {
- super(name);
- }
-
- public void testCtors() {
- Counter counter;
- counter = new Counter();
- assertEquals(0, counter.count());
- counter = new Counter(7);
- assertEquals(7, counter.count());
- counter = new Counter(-7);
- assertEquals(-7, counter.count());
- }
-
- public void testIncrement() {
- Counter counter;
- int count;
- counter = new Counter();
- assertEquals(0, counter.count());
-
- count = counter.increment(3);
- assertEquals(3, count);
- assertEquals(3, counter.count());
-
- count = counter.increment();
- assertEquals(4, count);
- assertEquals(4, counter.count());
-
- count = counter.increment(-7);
- assertEquals(-3, count);
- assertEquals(-3, counter.count());
- }
-
- public void testDecrement() {
- Counter counter;
- int count;
- counter = new Counter();
- assertEquals(0, counter.count());
-
- count = counter.decrement(3);
- assertEquals(-3, count);
- assertEquals(-3, counter.count());
-
- count = counter.decrement();
- assertEquals(-4, count);
- assertEquals(-4, counter.count());
-
- count = counter.decrement(-7);
- assertEquals(3, count);
- assertEquals(3, counter.count());
- }
-
- public void testClone() {
- Counter counter = new Counter(44);
- Counter counter2 = (Counter) counter.clone();
- assertEquals(44, counter2.count());
- assertEquals(counter, counter2);
- assertNotSame(counter, counter2);
- }
-
- public void testEquals() {
- Counter counter = new Counter(44);
- Counter counter2 = new Counter(44);
- assertEquals(counter, counter2);
- assertEquals(counter.hashCode(), counter2.hashCode());
- }
-
- public void testSerialization() throws Exception {
- Counter counter = new Counter(44);
- Counter counter2 = TestTools.serialize(counter);
- assertEquals(44, counter2.count());
- assertEquals(counter, counter2);
- assertNotSame(counter, counter2);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java
deleted file mode 100644
index 25692053c8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.EmptyIterable;
-
-import junit.framework.TestCase;
-
-public class EmptyIterableTests extends TestCase {
-
- public EmptyIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- int i = 0;
- for (String string : EmptyIterable.<String>instance()) {
- fail("bogus string: " + string);
- i++;
- }
- assertEquals(0, i);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java
deleted file mode 100644
index adcccf0992..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.FileTools;
-
-public class FileToolsTests extends TestCase {
- private File tempDir;
-
- public FileToolsTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.tempDir = this.buildTempDir();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- this.deleteDir(this.tempDir);
- }
-
- public void testFilesIn() {
- Collection<File> files = CollectionTools.collection(FileTools.filesIn(this.tempDir.getPath()));
- assertEquals("invalid file count", 3, files.size());
- }
-
- public void testDirectoriesIn() {
- Collection<File> files = CollectionTools.collection(FileTools.directoriesIn(this.tempDir.getPath()));
- assertEquals("invalid directory count", 2, files.size());
- }
-
- public void testFilesInTree() {
- Collection<File> files = CollectionTools.collection(FileTools.filesInTree(this.tempDir.getPath()));
- assertEquals("invalid file count", 9, files.size());
- }
-
- public void testDirectoriesInTree() {
- Collection<File> files = CollectionTools.collection(FileTools.directoriesInTree(this.tempDir.getPath()));
- assertEquals("invalid directory count", 3, files.size());
- }
-
- public void testDeleteDirectory() throws IOException {
- // build another temporary directory just for this test
- File dir = this.buildTempDir();
- assertTrue("temporary directory not created", dir.exists());
- FileTools.deleteDirectory(dir.getPath());
- assertFalse("temporary directory not deleted", dir.exists());
- }
-
- public void testDeleteDirectoryContents() throws IOException {
- // build another temporary directory just for this test
- File dir = this.buildTempDir();
- assertTrue("temporary directory not created", dir.exists());
- FileTools.deleteDirectoryContents(dir.getPath());
- assertTrue("temporary directory should not have been deleted", dir.exists());
- assertTrue("temporary directory contents not deleted", dir.listFiles().length == 0);
- dir.delete();
- }
-
- public void testCopyToFile() throws IOException {
- File destFile = new File(this.tempDir, "destfile.txt");
- this.copyToFile(destFile, "testCopyToFile");
- }
-
- public void testCopyToPreExistingFile() throws IOException {
- File destFile = new File(this.tempDir, "destfile.txt");
- Writer writer = new OutputStreamWriter(new FileOutputStream(destFile));
- writer.write("this text should be replaced...");
- writer.close();
- this.copyToFile(destFile, "testCopyToPreExistingFile");
- }
-
- private void copyToFile(File destFile, String writeString) throws IOException {
- File sourceFile = new File(this.tempDir, "sourcefile.txt");
- char[] readBuffer = new char[writeString.length()];
-
- Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile));
- writer.write(writeString);
- writer.close();
-
- FileTools.copyToFile(sourceFile, destFile);
-
- Reader reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- String readString = new String(readBuffer);
- assertEquals(writeString, readString);
- }
-
- public void testCopyToDirectory() throws IOException {
- File sourceFile = new File(this.tempDir, "sourcefile.txt");
- String writeString = "testCopyToDirectory";
-
- File destDir = new File(this.tempDir, "destdir");
- destDir.mkdir();
- File destFile = new File(destDir, "sourcefile.txt");
- char[] readBuffer = new char[writeString.length()];
-
- Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile));
- writer.write(writeString);
- writer.close();
-
- FileTools.copyToDirectory(sourceFile, destDir);
-
- Reader reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- String readString = new String(readBuffer);
- assertEquals(writeString, readString);
- }
-
- public void testFilter() throws IOException {
- String prefix = "XXXtestFileXXX";
- File testFile1 = new File(this.tempDir, prefix + "1");
- testFile1.createNewFile();
- File testFile2 = new File(this.tempDir, prefix + "2");
- testFile2.createNewFile();
-
- FileFilter filter = this.buildFileFilter(prefix);
- Iterator<File> filteredFilesIterator = FileTools.filter(FileTools.filesIn(this.tempDir), filter);
- Collection<File> filteredFiles = CollectionTools.collection(filteredFilesIterator);
- assertEquals(2, filteredFiles.size());
- assertTrue(filteredFiles.contains(testFile1));
- assertTrue(filteredFiles.contains(testFile2));
- }
-
- private FileFilter buildFileFilter(final String prefix) {
- return new FileFilter() {
- public boolean accept(File file) {
- return file.getName().startsWith(prefix);
- }
- };
- }
-
- public void testStripExtension() {
- assertEquals("foo", FileTools.stripExtension("foo.xml"));
- assertEquals("foo.bar", FileTools.stripExtension("foo.bar.xml"));
- assertEquals("foo", FileTools.stripExtension("foo"));
- assertEquals("foo", FileTools.stripExtension("foo."));
- }
-
- public void testExtension() {
- assertEquals(".xml", FileTools.extension("foo.xml"));
- assertEquals(".xml", FileTools.extension("foo.bar.xml"));
- assertEquals("", FileTools.extension("foo"));
- assertEquals("", FileTools.extension("foo,xml"));
- assertEquals(".", FileTools.extension("foo."));
- }
-
- public void testEmptyTemporaryDirectory() throws IOException {
- File tempDir1 = FileTools.temporaryDirectory();
- File testFile1 = new File(tempDir1, "junk");
- testFile1.createNewFile();
-
- File tempDir2 = FileTools.emptyTemporaryDirectory();
- assertEquals(tempDir1, tempDir2);
- assertTrue(tempDir2.isDirectory());
- assertEquals(0, tempDir2.listFiles().length);
- tempDir2.delete();
- }
-
- public void testCanonicalFileName() {
- File file1 = new File("foo");
- file1 = new File(file1, "bar");
- file1 = new File(file1, "baz");
- file1 = new File(file1, "..");
- file1 = new File(file1, "..");
- file1 = new File(file1, "bar");
- file1 = new File(file1, "baz");
- File file2 = new File(System.getProperty("user.dir"));
- file2 = new File(file2, "foo");
- file2 = new File(file2, "bar");
- file2 = new File(file2, "baz");
- File file3 = FileTools.canonicalFile(file1);
- assertEquals(file2, file3);
- }
-
- private boolean isExecutingOnWindows() {
- return this.isExecutingOn("Windows");
- }
-
- // private boolean isExecutingOnLinux() {
- // return this.isExecutingOn("Linux");
- // }
- //
- private boolean isExecutingOn(String osName) {
- return System.getProperty("os.name").indexOf(osName) != -1;
- }
-
- public void testPathFiles() {
- File[] expected;
- File[] actual;
-
- if (this.isExecutingOnWindows()) {
- expected = new File[] { new File("C:/"), new File("C:/foo"), new File("C:/foo/bar"), new File("C:/foo/bar/baz.txt") };
- actual = this.pathFiles(new File("C:/foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
- }
-
- expected = new File[] { new File("/"), new File("/foo"), new File("/foo/bar"), new File("/foo/bar/baz.txt") };
- actual = this.pathFiles(new File("/foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File("foo"), new File("foo/bar"), new File("foo/bar/baz.txt") };
- actual = this.pathFiles(new File("foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File(".."), new File("../foo"), new File("../foo/bar"), new File("../foo/bar/baz.txt") };
- actual = this.pathFiles(new File("../foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File("."), new File("./foo"), new File("./foo/bar"), new File("./foo/bar/baz.txt") };
- actual = this.pathFiles(new File("./foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
- }
-
- private File[] pathFiles(File file) {
- return (File[]) ClassTools.executeStaticMethod(FileTools.class, "pathFiles", File.class, file);
- }
-
- public void testRelativeParentFile() {
- assertEquals(new File(".."), this.relativeParentFile(1));
- assertEquals(new File("../.."), this.relativeParentFile(2));
- assertEquals(new File("../../.."), this.relativeParentFile(3));
-
- boolean exCaught = false;
- try {
- File file = this.relativeParentFile(0);
- fail("invalid return: " + file);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- InvocationTargetException ite = (InvocationTargetException) ex.getCause();
- if (ite.getTargetException() instanceof IllegalArgumentException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- private File relativeParentFile(int len) {
- return (File) ClassTools.executeStaticMethod(FileTools.class, "relativeParentFile", int.class, new Integer(len));
- }
-
- public void testConvertToRelativeFile() {
- String prefix = this.isExecutingOnWindows() ? "C:" : "";
- File file;
- File dir;
- File relativeFile;
-
- if (this.isExecutingOnWindows()) {
- // on Windows, a drive must be specified for a file to be absolute (i.e. not relative)
- this.verifyUnchangedRelativeFile("/dir1/dir2/file.txt", "C:/dir1/dir2");
- // different drives
- this.verifyUnchangedRelativeFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2");
- }
- this.verifyUnchangedRelativeFile("dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedRelativeFile("./dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedRelativeFile("../../dir1/dir2/file.txt", prefix + "/dir1/dir2");
-
- file = new File(prefix + "/dir1/dir2");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("."), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/../dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("dir3/dir4/dir5/file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../../file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../../dirA/dirB/dirC/file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../.."), relativeFile);
-
- file = new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar");
- dir = new File(prefix + "/My Documents/My Workspace/Project 1");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("lib/toplink.jar"), relativeFile);
- }
-
- private void verifyUnchangedRelativeFile(String fileName, String dirName) {
- File file = new File(fileName);
- File dir = new File(dirName);
- File relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(file, relativeFile);
- }
-
- public void testConvertToAbsoluteFile() {
- String prefix = this.isExecutingOnWindows() ? "C:" : "";
- File file;
- File dir;
- File absoluteFile;
-
- if (this.isExecutingOnWindows()) {
- // on Windows, a drive must be specified for a file to be absolute (i.e. not relative)
- this.verifyUnchangedAbsoluteFile("C:/dir1/dir2/file.txt", "C:/dir1/dir2");
- // different drives
- this.verifyUnchangedAbsoluteFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2");
- }
- this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedAbsoluteFile(prefix + "/./dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/../../dir1/dir2/file.txt", prefix + "/dir1/dir2");
-
- file = new File(".");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile);
-
- file = new File("./file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("../dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("dir3/dir4/dir5/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt"), absoluteFile);
-
- file = new File("../../../file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- // too many ".." directories will resolve to the root;
- // this is consistent with Windows and Linux command shells
- file = new File("../../../../../../../../file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/file.txt"), absoluteFile);
-
- file = new File("../file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("../../../dirA/dirB/dirC/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt"), absoluteFile);
-
- file = new File("../../..");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile);
-
- file = new File("lib/toplink.jar");
- dir = new File(prefix + "/My Documents/My Workspace/Project 1");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar"), absoluteFile);
- }
-
- public void testFileNameIsReserved() {
- boolean expected = this.isExecutingOnWindows();
- assertEquals(expected, FileTools.fileNameIsReserved("CON"));
- assertEquals(expected, FileTools.fileNameIsReserved("con"));
- assertEquals(expected, FileTools.fileNameIsReserved("cON"));
- assertEquals(expected, FileTools.fileNameIsReserved("AUX"));
- assertEquals(expected, FileTools.fileNameIsReserved("COM3"));
- assertEquals(expected, FileTools.fileNameIsReserved("LPT3"));
- assertEquals(expected, FileTools.fileNameIsReserved("nUL"));
- assertEquals(expected, FileTools.fileNameIsReserved("Prn"));
- }
-
- public void testFileHasAnyReservedComponents() {
- boolean expected = this.isExecutingOnWindows();
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("C:/CON")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("/con/foo")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/temp/cON")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("bar//baz//AUX")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("COM3//ttt")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("d:/LPT3/xxx")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/my docs and stuff/tuesday/nUL")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("Prn")));
- }
-
- public void testShortenFileNameFile() {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameFileWin();
- } else {
- this.verifyShortenFileNameFileNonWin();
- }
- }
-
- private void verifyShortenFileNameFileWin() {
- File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt");
- String fileName = FileTools.shortenFileName(file);
- assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
-
- file = new File("C:/");
- fileName = FileTools.shortenFileName(file);
- assertEquals("C:\\", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- private void verifyShortenFileNameFileNonWin() {
- File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(file);
- assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
-
- file = new File("/home");
- fileName = FileTools.shortenFileName(file);
- assertEquals("/home", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- public void testShortenFileNameFileInt() {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameFileIntWin();
- } else {
- this.verifyShortenFileNameFileIntNonWin();
- }
- }
-
- private void verifyShortenFileNameFileIntWin() {
- File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt");
- String fileName = FileTools.shortenFileName(file, 31);
- assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName);
- assertEquals(31, fileName.length());
-
- file = new File("C:/This is the file name.txt");
- fileName = FileTools.shortenFileName(file, 10);
- assertEquals("C:\\This is the file name.txt", fileName);
- assertEquals(28, fileName.length());
- }
-
- private void verifyShortenFileNameFileIntNonWin() {
- File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(file, 31);
- assertEquals("/home/.../desktop/Project/Text.txt", fileName);
- assertEquals(34, fileName.length());
-
- file = new File("/This is the file name.txt");
- fileName = FileTools.shortenFileName(file, 10);
- assertEquals("/This is the file name.txt", fileName);
- assertEquals(26, fileName.length());
- }
-
- public void testShortenFileNameURL() throws Exception {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameURLWin();
- } else {
- this.verifyShortenFileNameURLNonWin();
- }
- }
-
- private void verifyShortenFileNameURLWin() throws Exception {
- URL url = new URL("file", "", "C:/Documents and Settings/Administrator/Desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url);
- assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- private void verifyShortenFileNameURLNonWin() throws Exception {
- URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url);
- assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- public void testShortenFileNameURLInt() throws Exception {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameURLIntWin();
- } else {
- this.verifyShortenFileNameURLIntNonWin();
- }
- }
-
- private void verifyShortenFileNameURLIntWin() throws Exception {
- URL url = new URL("file", "", "/C:/Documents and Settings/Administrator/Desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url, 31);
- assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName);
- assertEquals(31, fileName.length());
- }
-
- private void verifyShortenFileNameURLIntNonWin() throws Exception {
- URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url, 31);
- assertEquals("/home/.../desktop/Project/Text.txt", fileName);
- assertEquals(34, fileName.length());
- }
-
- private void verifyUnchangedAbsoluteFile(String fileName, String dirName) {
- File file = new File(fileName);
- File dir = new File(dirName);
- File absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(file, absoluteFile);
- }
-
- private File buildTempDir() throws IOException {
- // build a new directory for each test, to prevent any cross-test effects
- File dir = FileTools.newTemporaryDirectory(ClassTools.shortClassNameForObject(this) + "." + this.getName());
-
- File file0a = new File(dir, "file0a");
- file0a.createNewFile();
- File file0b = new File(dir, "file0b");
- file0b.createNewFile();
- File file0c = new File(dir, "file0c");
- file0c.createNewFile();
-
- File subdir1 = new File(dir, "subdir1");
- subdir1.mkdir();
- File file1a = new File(subdir1, "file1a");
- file1a.createNewFile();
- File file1b = new File(subdir1, "file1b");
- file1b.createNewFile();
-
- File subdir2 = new File(dir, "subdir2");
- subdir2.mkdir();
- File file2a = new File(subdir2, "file2a");
- file2a.createNewFile();
- File file2b = new File(subdir2, "file2b");
- file2b.createNewFile();
-
- File subdir3 = new File(subdir2, "subdir3");
- subdir3.mkdir();
- File file3a = new File(subdir3, "file3a");
- file3a.createNewFile();
- File file3b = new File(subdir3, "file3b");
- file3b.createNewFile();
-
- return dir;
- }
-
- private void deleteDir(File dir) {
- FileTools.deleteDirectory(dir);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
deleted file mode 100644
index aa6012c2a4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("nls")
-public class HashBagTests extends TestCase {
- private HashBag<String> bag;
-
- public HashBagTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bag = this.buildBag();
- }
-
- private HashBag<String> buildBag() {
- HashBag<String> b = new HashBag<String>();
- b.add(null);
- b.add(new String("one"));
- b.add(new String("two"));
- b.add(new String("two"));
- b.add(new String("three"));
- b.add(new String("three"));
- b.add(new String("three"));
- b.add(new String("four"));
- b.add(new String("four"));
- b.add(new String("four"));
- b.add(new String("four"));
- return b;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add(new String("foo"));
- c.add(new String("foo"));
- c.add(new String("bar"));
- c.add(new String("bar"));
- c.add(new String("bar"));
- return c;
- }
-
- public void testCtorCollection() {
- Collection<String> c = this.buildCollection();
- Bag<String> b = new HashBag<String>(c);
- for (String s : c) {
- assertTrue(b.contains(s));
- }
- }
-
- public void testCtorIntFloat() {
- boolean exCaught;
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(-20, 0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- assertTrue(this.bag.add("five"));
-
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains("five"));
- }
-
- public void testAddCount() {
- // the other adds took place in setUp
- this.bag.add("minus3", -3);
- this.bag.add("zero", 0);
- this.bag.add("five", 5);
-
- assertFalse(this.bag.contains("minus3"));
- assertFalse(this.bag.contains("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(5, this.bag.count("five"));
-
- this.bag.add("three", 2);
- assertEquals(5, this.bag.count("three"));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue(this.bag.addAll(c));
- for (String s : c) {
- assertTrue(this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains(null));
- assertEquals(11, this.bag.size());
- this.bag.clear();
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.contains("four"));
- assertFalse(this.bag.contains(null));
- assertEquals(0, this.bag.size());
- }
-
- public void testClone() {
- Bag<String> bag2 = this.bag.clone();
- assertTrue(this.bag != bag2);
- assertEquals(this.bag, bag2);
- assertTrue(this.bag.hashCode() == bag2.hashCode());
- }
-
- public void testContains() {
- assertTrue(this.bag.contains(null));
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains(new String("four")));
- assertTrue(this.bag.contains("fo" + "ur"));
- assertFalse(this.bag.contains("five"));
- }
-
- public void testContainsAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(null);
- c.add(new String("one"));
- c.add(new String("two"));
- c.add(new String("three"));
- c.add(new String("four"));
- assertTrue(this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals(0, this.bag.count("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(0, this.bag.count("five"));
- }
-
- public void testEquals() {
- Bag<String> bag2 = this.buildBag();
- assertEquals(this.bag, bag2);
- bag2.add("five");
- assertFalse(this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse(this.bag.equals(c));
- }
-
- public void testHashCode() {
- Bag<String> bag2 = this.buildBag();
- assertEquals(this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse(this.bag.isEmpty());
- this.bag.clear();
- assertTrue(this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse(this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.iterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(11, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- iterator.remove();
- assertEquals(10, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.iterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUniqueIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.uniqueIterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !"four".equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEntries() {
- int i = 0;
- Iterator<Bag.Entry<String>> iterator = this.bag.entries();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- Bag.Entry<String> next = null;
- while (iterator.hasNext()) {
- next = iterator.next();
- if (next.getElement().equals("four")) {
- iterator.remove();
- break;
- }
- }
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-//TODO - poor load factor is seen in the Eclipse build environment for some reason
-// public void testHashingDistribution() throws Exception {
-// Bag<String> bigBag = new HashBag<String>();
-// for (int i = 0; i < 10000; i++) {
-// bigBag.add("object" + i);
-// }
-//
-// java.lang.reflect.Field field = bigBag.getClass().getDeclaredField("table");
-// field.setAccessible(true);
-// Object[] table = (Object[]) field.get(bigBag);
-// int bucketCount = table.length;
-// int filledBucketCount = 0;
-// for (Object o : table) {
-// if (o != null) {
-// filledBucketCount++;
-// }
-// }
-// float loadFactor = ((float) filledBucketCount) / ((float) bucketCount);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75);
-// }
-
- public void testRemove() {
- assertTrue(this.bag.remove("one"));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.remove("one"));
-
- assertTrue(this.bag.remove("two"));
- assertTrue(this.bag.remove("two"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.remove("two"));
- }
-
- public void testRemoveCount() {
- assertFalse(this.bag.remove("one", 0));
- assertTrue(this.bag.contains("one"));
-
- assertTrue(this.bag.remove("one", 1));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.remove("one"));
-
- assertFalse(this.bag.remove("two", -3));
- assertTrue(this.bag.remove("two", 1));
- assertTrue(this.bag.contains("two"));
-
- assertTrue(this.bag.remove("two", 1));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.remove("two"));
-
- assertTrue(this.bag.remove("three", 3));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.remove("three"));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue(this.bag.removeAll(c));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.remove("one"));
- assertFalse(this.bag.remove("three"));
- assertFalse(this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue(this.bag.retainAll(c));
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("three"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.contains("four"));
- assertFalse(this.bag.remove("two"));
- assertFalse(this.bag.remove("four"));
- assertFalse(this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue(this.bag.size() == 11);
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- assertEquals(16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- Bag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals(11, bag2.size());
- assertEquals(this.bag, bag2);
- // look for similar elements
- assertTrue(bag2.contains(null));
- assertTrue(bag2.contains("one"));
- assertTrue(bag2.contains("two"));
- assertTrue(bag2.contains("three"));
- assertTrue(bag2.contains("four"));
-
- int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0;
- for (String s : bag2) {
- if (s == null) {
- nullCount++;
- } else if (s.equals("one")) {
- oneCount++;
- } else if (s.equals("two")) {
- twoCount++;
- } else if (s.equals("three")) {
- threeCount++;
- } else if (s.equals("four")) {
- fourCount++;
- }
- }
- assertEquals(1, nullCount);
- assertEquals(1, oneCount);
- assertEquals(2, twoCount);
- assertEquals(3, threeCount);
- assertEquals(4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals(11, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, "one"));
- assertTrue(CollectionTools.contains(a, "two"));
- assertTrue(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals(a, b);
- assertEquals(12, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, "one"));
- assertTrue(CollectionTools.contains(a, "two"));
- assertTrue(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue(s.startsWith("["));
- assertTrue(s.endsWith("]"));
- int commaCount = 0;
- for (int i = 0; i < s.length(); i++) {
- if (s.charAt(i) == ',') {
- commaCount++;
- }
- }
- assertEquals(10, commaCount);
- assertTrue(s.indexOf("one") != -1);
- assertTrue(s.indexOf("two") != -1);
- assertTrue(s.indexOf("three") != -1);
- assertTrue(s.indexOf("four") != -1);
- assertTrue(s.indexOf("null") != -1);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java
deleted file mode 100644
index b51cbb13f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.IdentityHashBag;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("nls")
-public class IdentityHashBagTests extends TestCase {
- private IdentityHashBag<String> bag;
- private String one = "one";
- private String two = "two";
- private String three = "three";
- private String four = "four";
- private String foo = "foo";
- private String bar = "bar";
-
- public IdentityHashBagTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bag = this.buildBag();
- }
-
- protected IdentityHashBag<String> buildBag() {
- IdentityHashBag<String> result = new IdentityHashBag<String>();
- result.add(null);
- result.add(this.one);
- result.add(this.two);
- result.add(this.two);
- result.add(this.three);
- result.add(this.three);
- result.add(this.three);
- result.add(this.four);
- result.add(this.four);
- result.add(this.four);
- result.add(this.four);
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.foo);
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.bar);
- c.add(this.bar);
- return c;
- }
-
- public void testCtorCollection() {
- Collection<String> c = this.buildCollection();
- IdentityHashBag<String> localBag = new IdentityHashBag<String>(c);
- for (String s : c) {
- assertTrue(localBag.contains(s));
- }
- }
-
- public void testCtorIntFloat() {
- boolean exCaught;
-
- exCaught = false;
- try {
- this.bag = new IdentityHashBag<String>(-20, 0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
-
- exCaught = false;
- try {
- this.bag = new IdentityHashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- String five = "five";
- assertTrue(this.bag.add(five));
-
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
- assertTrue(this.bag.contains(five));
- }
-
- public void testAddCount() {
- String minus3 = "minus3";
- String zero = "zero";
- String five = "five";
- // the other adds took place in setUp
- this.bag.add(minus3, -3);
- this.bag.add(zero, 0);
- this.bag.add(five, 5);
-
- assertFalse(this.bag.contains(minus3));
- assertFalse(this.bag.contains(zero));
- assertEquals(1, this.bag.count(this.one));
- assertEquals(2, this.bag.count(this.two));
- assertEquals(3, this.bag.count(this.three));
- assertEquals(4, this.bag.count(this.four));
- assertEquals(5, this.bag.count(five));
-
- this.bag.add(this.three, 2);
- assertEquals(5, this.bag.count(this.three));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue(this.bag.addAll(c));
- for (String s : c) {
- assertTrue(this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
- assertTrue(this.bag.contains(null));
- assertEquals(11, this.bag.size());
- this.bag.clear();
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.contains(this.four));
- assertFalse(this.bag.contains(null));
- assertEquals(0, this.bag.size());
- }
-
- public void testClone() {
- IdentityHashBag<String> bag2 = this.bag.clone();
- assertTrue("bad clone", this.bag != bag2);
- assertEquals("bad clone", this.bag, bag2);
- assertTrue("bad clone", this.bag.hashCode() == bag2.hashCode());
- }
-
- public void testContains() {
- assertTrue(this.bag.contains(null));
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
-
- assertFalse(this.bag.contains(new String("four")));
- assertFalse(this.bag.contains("five"));
- }
-
- public void testContainsAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(null);
- c.add(this.one);
- c.add(this.two);
- c.add(this.three);
- c.add(this.four);
- assertTrue(this.bag.containsAll(c));
- c.add(new String(this.four));
- assertFalse(this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals(0, this.bag.count("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(0, this.bag.count("five"));
- }
-
- public void testEquals() {
- IdentityHashBag<String> bag2 = this.buildBag();
- assertEquals(this.bag, bag2);
- bag2.add("five");
- assertFalse(this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse(this.bag.equals(c));
- }
-
- public void testHashCode() {
- IdentityHashBag<String> bag2 = this.buildBag();
- assertEquals(this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse(this.bag.isEmpty());
- this.bag.clear();
- assertTrue(this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse(this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- public void testIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.iterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(11, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- iterator.remove();
- assertEquals(10, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
-
- // start over
- iterator = this.bag.iterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue("ConcurrentModificationException not thrown", exCaught);
- }
-
- public void testUniqueIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.uniqueIterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !this.four.equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- String five = "five";
- this.bag.add(five);
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEntries() {
- int i = 0;
- Iterator<org.eclipse.jpt.utility.internal.Bag.Entry<String>> iterator = this.bag.entries();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- org.eclipse.jpt.utility.internal.Bag.Entry<String> next = null;
- while (iterator.hasNext()) {
- next = iterator.next();
- if (next.getElement().equals(this.four)) {
- iterator.remove();
- break;
- }
- }
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- String five = "five";
- this.bag.add(five);
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- // Commenting out this test as it is also failing in the Eclipse build
- // apparenly there are some hashing issues that need to be looked into.
-// public void testHashingDistribution() throws Exception {
-// IdentityHashBag<String> bigBag = new IdentityHashBag<String>();
-// for (int i = 0; i < 10000; i++) {
-// bigBag.add("object" + i);
-// }
-//
-// java.lang.reflect.Field field = bigBag.getClass().getDeclaredField("table");
-// field.setAccessible(true);
-// Object[] table = (Object[]) field.get(bigBag);
-// int bucketCount = table.length;
-// int filledBucketCount = 0;
-// for (int i = 0; i < bucketCount; i++) {
-// if (table[i] != null) {
-// filledBucketCount++;
-// }
-// }
-// float loadFactor = ((float) filledBucketCount)/((float) bucketCount);
-// // System.out.println("load factor: " + loadFactor + " (" + filledBucketCount + "/" + bucketCount + ")");
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75);
-// }
-
- public void testRemove() {
- assertTrue(this.bag.remove(this.one));
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.remove(this.one));
-
- assertTrue(this.bag.remove(this.two));
- assertTrue(this.bag.remove(this.two));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.remove(this.two));
-
- assertFalse(this.bag.remove(new String(this.three)));
- }
-
- public void testRemoveCount() {
- assertFalse(this.bag.remove(this.one, 0));
- assertTrue(this.bag.contains(this.one));
-
- assertTrue(this.bag.remove(this.one, 1));
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.remove(this.one));
-
- assertFalse(this.bag.remove(this.two, -3));
- assertTrue(this.bag.remove(this.two, 1));
- assertTrue(this.bag.contains(this.two));
-
- assertTrue(this.bag.remove(this.two, 1));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.remove(this.two));
-
- assertTrue(this.bag.remove(this.three, 3));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.remove(this.three));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.one);
- c.add(new String(this.two));
- c.add(this.three);
- assertTrue(this.bag.removeAll(c));
- assertFalse(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.remove(this.one));
- assertTrue(this.bag.remove(this.two));
- assertFalse(this.bag.remove(this.three));
- assertFalse(this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.one);
- c.add(new String(this.two));
- c.add(this.three);
- assertTrue(this.bag.retainAll(c));
- assertTrue(this.bag.contains(this.one));
- assertFalse(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertFalse(this.bag.contains(this.four));
- assertFalse(this.bag.remove(this.two));
- assertFalse(this.bag.remove(this.four));
- assertFalse(this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue(this.bag.size() == 11);
- String five = "five";
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(new String(five));
- assertEquals(16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- IdentityHashBag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals(11, bag2.size());
- assertEquals(CollectionTools.bag(this.bag.iterator()), CollectionTools.bag(bag2.iterator()));
- // look for similar elements
- assertTrue(CollectionTools.bag(bag2.iterator()).contains(null));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("one"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("two"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("three"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("four"));
-
- int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0;
- for (String next : bag2) {
- if (next == null)
- nullCount++;
- else if (next.equals("one"))
- oneCount++;
- else if (next.equals("two"))
- twoCount++;
- else if (next.equals("three"))
- threeCount++;
- else if (next.equals("four"))
- fourCount++;
- }
- assertEquals(1, nullCount);
- assertEquals(1, oneCount);
- assertEquals(2, twoCount);
- assertEquals(3, threeCount);
- assertEquals(4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals(11, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, this.one));
- assertTrue(CollectionTools.contains(a, this.two));
- assertTrue(CollectionTools.contains(a, this.three));
- assertTrue(CollectionTools.contains(a, this.four));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals(a, b);
- assertEquals(12, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, this.one));
- assertTrue(CollectionTools.contains(a, this.two));
- assertTrue(CollectionTools.contains(a, this.three));
- assertTrue(CollectionTools.contains(a, this.four));
- assertTrue(a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue(s.startsWith("["));
- assertTrue(s.endsWith("]"));
- int commaCount = 0;
- for (int i = 0; i < s.length(); i++) {
- if (s.charAt(i) == ',') {
- commaCount++;
- }
- }
- assertEquals("invalid number of commas", 10, commaCount);
- assertTrue(s.indexOf("one") != -1);
- assertTrue(s.indexOf("two") != -1);
- assertTrue(s.indexOf("three") != -1);
- assertTrue(s.indexOf("four") != -1);
- assertTrue(s.indexOf("null") != -1);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java
deleted file mode 100644
index b971895bc1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.io.StringWriter;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-
-public class IndentingPrintWriterTests extends TestCase {
- StringWriter sw1;
- StringWriter sw2;
- IndentingPrintWriter ipw1;
- IndentingPrintWriter ipw2;
-
- static final String CR = System.getProperty("line.separator");
-
- public IndentingPrintWriterTests(String name) {
- super(name);
- }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- this.sw1 = new StringWriter();
- this.ipw1 = new IndentingPrintWriter(this.sw1);
- this.sw2 = new StringWriter();
- this.ipw2 = new IndentingPrintWriter(this.sw2, " "); // indent with 4 spaces instead of a tab
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIndent() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- }
-
- public void testUndent() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- this.ipw1.undent();
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- }
-
- public void testIncrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- }
-
- public void testDecrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- this.ipw1.decrementIndentLevel();
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- }
-
- public void testPrintTab() {
- String expected = "foo0" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "\t\tfoo2" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "foo0" + CR;
-
- this.ipw1.println("foo0");
- this.ipw1.indent();
- this.ipw1.println("foo1");
- this.ipw1.println("foo1");
- this.ipw1.indent();
- this.ipw1.println("foo2");
- this.ipw1.undent();
- this.ipw1.println("foo1");
- this.ipw1.println("foo1");
- this.ipw1.undent();
- this.ipw1.println("foo0");
-
- assertEquals("bogus output", expected, this.sw1.toString());
- }
-
- public void testPrintSpaces() {
- String expected = "foo0" + CR + " foo1" + CR + " foo1" + CR + " foo2" + CR + " foo1" + CR + " foo1" + CR + "foo0" + CR;
-
- this.ipw2.println("foo0");
- this.ipw2.indent();
- this.ipw2.println("foo1");
- this.ipw2.println("foo1");
- this.ipw2.indent();
- this.ipw2.println("foo2");
- this.ipw2.undent();
- this.ipw2.println("foo1");
- this.ipw2.println("foo1");
- this.ipw2.undent();
- this.ipw2.println("foo0");
-
- assertEquals("bogus output", expected, this.sw2.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
deleted file mode 100644
index 07dad198b5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.sql.Types;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.JDBCType;
-
-public class JDBCTypeTests extends TestCase {
-
- public JDBCTypeTests(String name) {
- super(name);
- }
-
- public void testTypesSize() {
- assertEquals(Types.class.getDeclaredFields().length, JDBCType.types().length);
- }
-
- public void testName() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals("VARCHAR", jdbcType.name());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals("INTEGER", jdbcType.name());
- }
-
- public void testCode() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals(Types.VARCHAR, jdbcType.code());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals(Types.INTEGER, jdbcType.code());
- }
-
- public void testInvalidTypeCode() throws Exception {
- boolean exCaught = false;
- try {
- JDBCType jdbcType = JDBCType.type(55);
- fail("invalid JDBCType: " + jdbcType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidTypeName() throws Exception {
- boolean exCaught = false;
- try {
- JDBCType jdbcType = JDBCType.type("VARCHAR2");
- fail("invalid JDBCType: " + jdbcType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java
deleted file mode 100644
index e26336ab6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.internal.SimpleJavaType;
-
-import junit.framework.TestCase;
-
-public class JavaTypeTests extends TestCase {
-
- public JavaTypeTests(String name) {
- super(name);
- }
-
- public void testInvalidElementTypeNull() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(null, 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidElementTypeEmpty() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType("", 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidElementTypeArray() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(java.lang.Object[].class.getName(), 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidArrayDepthNegative() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(java.lang.Object.class.getName(), -2);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidVoidArray() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(void.class.getName(), 2);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testElementTypeName() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals("int", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals("int", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals("void", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map$Entry", javaType.getElementTypeName());
- }
-
- public void testArrayDepth() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals(1, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals(1, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals(2, javaType.getArrayDepth());
- }
-
- public void testIsArray() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertTrue(javaType.isArray());
-
- javaType = new SimpleJavaType(int.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(int[].class);
- assertTrue(javaType.isArray());
-
- javaType = new SimpleJavaType(void.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertTrue(javaType.isArray());
- }
-
- public void testJavaClass() throws Exception {
- this.verifyJavaClass(java.lang.Object.class);
- this.verifyJavaClass(java.lang.Object[].class);
- this.verifyJavaClass(int.class);
- this.verifyJavaClass(int[].class);
- this.verifyJavaClass(void.class);
- this.verifyJavaClass(java.util.Map.Entry.class);
- this.verifyJavaClass(java.util.Map.Entry[][].class);
- }
-
- private void verifyJavaClass(Class<?> javaClass) throws Exception {
- JavaType javaType = new SimpleJavaType(javaClass);
- assertEquals(javaClass, javaType.getJavaClass());
- }
-
- public void testJavaClassName() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals("[Ljava.lang.Object;", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals("int", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals("[I", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals("void", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals("[[Ljava.util.Map$Entry;", javaType.getJavaClassName());
- }
-
- public void testDescribes() throws Exception {
- this.verifyDescribes(java.lang.Object.class);
- this.verifyDescribes(java.lang.Object[].class);
- this.verifyDescribes(int.class);
- this.verifyDescribes(int[].class);
- this.verifyDescribes(void.class);
- this.verifyDescribes(java.util.Map.Entry.class);
- this.verifyDescribes(java.util.Map.Entry[][].class);
- }
-
- private void verifyDescribes(Class<?> javaClass) throws Exception {
- JavaType javaType = new SimpleJavaType(javaClass);
- assertTrue(javaType.describes(javaClass));
- }
-
- public void testDeclaration() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.declaration());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object[]", javaType.declaration());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals("int", javaType.declaration());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals("int[]", javaType.declaration());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals("void", javaType.declaration());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map.Entry", javaType.declaration());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map.Entry[][]", javaType.declaration());
- }
-
- public void testIsPrimitive() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(int.class);
- assertTrue(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(int[].class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(void.class);
- assertTrue(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertFalse(javaType.isPrimitive());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
deleted file mode 100644
index bc306c0ef7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.tests.internal.iterators.JptUtilityIteratorsTests;
-import org.eclipse.jpt.utility.tests.internal.model.JptUtilityModelTests;
-import org.eclipse.jpt.utility.tests.internal.node.JptUtilityNodeTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityIteratorsTests.suite());
- suite.addTest(JptUtilityModelTests.suite());
- suite.addTest(JptUtilityNodeTests.suite());
-
- suite.addTestSuite(BitToolsTests.class);
- suite.addTestSuite(BooleanHolderTests.class);
- suite.addTestSuite(ClasspathTests.class);
- suite.addTestSuite(ClassToolsTests.class);
- suite.addTestSuite(CollectionToolsTests.class);
- suite.addTestSuite(CounterTests.class);
- suite.addTestSuite(EmptyIterableTests.class);
- suite.addTestSuite(FileToolsTests.class);
- suite.addTestSuite(HashBagTests.class);
- suite.addTestSuite(IdentityHashBagTests.class);
- suite.addTestSuite(IndentingPrintWriterTests.class);
- suite.addTestSuite(JavaTypeTests.class);
- suite.addTestSuite(JDBCTypeTests.class);
- suite.addTestSuite(MethodSignatureTests.class);
- suite.addTestSuite(NameToolsTests.class);
- suite.addTestSuite(RangeTests.class);
- suite.addTestSuite(ReverseComparatorTests.class);
- suite.addTestSuite(SimpleAssociationTests.class);
- suite.addTestSuite(SimpleStackTests.class);
- suite.addTestSuite(StringToolsTests.class);
- suite.addTestSuite(SynchronizedBooleanTests.class);
- suite.addTestSuite(SynchronizedObjectTests.class);
- suite.addTestSuite(SynchronizedStackTests.class);
- suite.addTestSuite(XMLStringEncoderTests.class);
-
- return suite;
- }
-
- private JptUtilityTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java
deleted file mode 100644
index b1d6f5bc1d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.utility.internal.SimpleMethodSignature;
-
-import junit.framework.TestCase;
-
-public class MethodSignatureTests extends TestCase {
-
- public MethodSignatureTests(String name) {
- super(name);
- }
-
- public void testInvalidNameNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature((String) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidNameEmpty() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("");
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypesNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", (JavaType[]) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypesNullItem() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new JavaType[1]);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypesVoidItem() throws Exception {
- JavaType jt = new SimpleJavaType(void.class.getName());
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new JavaType[] {jt});
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypeNamesNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", (String[]) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypeNamesNullItem() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new String[1]);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterJavaClassesNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", (Class<?>[]) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterJavaClassesNullItem() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new Class[1]);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testGetSignature0() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method0"));
- assertEquals("method0()", ms.getSignature());
- }
-
- public void testGetSignature1() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method1"));
- assertEquals("method1(int)", ms.getSignature());
- }
-
- public void testGetSignature2() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method2"));
- assertEquals("method2(int, java.lang.String)", ms.getSignature());
- }
-
- public void testGetSignature3() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method3"));
- assertEquals("method3(int, java.lang.String, java.lang.Object[][])", ms.getSignature());
- }
-
- public void testGetName() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method2"));
- assertEquals("method2", ms.getName());
- }
-
- public void testGetParameterTypes() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method3"));
- JavaType[] expected = new JavaType[3];
- expected[0] = new SimpleJavaType("int");
- expected[1] = new SimpleJavaType("java.lang.String");
- expected[2] = new SimpleJavaType("java.lang.Object", 2);
- assertTrue(Arrays.equals(expected, ms.getParameterTypes()));
- }
-
- public void testEquals() throws Exception {
- Object ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- Object ms2 = new SimpleMethodSignature(this.getMethod("method3"));
- assertNotSame(ms1, ms2);
- assertEquals(ms1, ms1);
- assertEquals(ms1, ms2);
- assertEquals(ms1.hashCode(), ms2.hashCode());
-
- Object ms3 = new SimpleMethodSignature(this.getMethod("method2"));
- assertNotSame(ms1, ms3);
- assertFalse(ms1.equals(ms3));
- }
-
- public void testCompareTo1() throws Exception {
- MethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- MethodSignature ms2 = new SimpleMethodSignature(this.getMethod("method3"));
- assertEquals(0, ms1.compareTo(ms2));
- }
-
- public void testCompareTo2() throws Exception {
- MethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- MethodSignature ms2 = new SimpleMethodSignature(this.getMethod("method2"));
- assertTrue(ms1.compareTo(ms2) > 0);
- }
-
- public void testCompareTo3() throws Exception {
- MethodSignature msA1 = new SimpleMethodSignature(this.getMethod("methodA", new Class[] {int.class, String.class}));
- MethodSignature msA2 = new SimpleMethodSignature(this.getMethod("methodA", new Class[] {int.class, String.class, String.class}));
- assertTrue(msA1.compareTo(msA2) < 0);
- }
-
- public void testCompareTo4() throws Exception {
- MethodSignature msB1 = new SimpleMethodSignature(this.getMethod("methodB", new Class[] {int.class, Object.class}));
- MethodSignature msB2 = new SimpleMethodSignature(this.getMethod("methodB", new Class[] {int.class, String.class}));
- assertTrue(msB1.compareTo(msB2) < 0);
- }
-
- public void testClone() throws Exception {
- SimpleMethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- SimpleMethodSignature ms2 = (SimpleMethodSignature) ms1.clone();
- assertNotSame(ms1, ms2);
- assertEquals(ms1, ms2);
- }
-
- public void testSerialization() throws Exception {
- SimpleMethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- SimpleMethodSignature ms2 = TestTools.serialize(ms1);
- assertNotSame(ms1, ms2);
- assertEquals(ms1, ms2);
- }
-
- private Method getMethod(String methodName) {
- for (Method method : this.getClass().getMethods()) {
- if (method.getName().equals(methodName)) {
- return method;
- }
- }
- throw new IllegalArgumentException("method not found: " + methodName);
- }
-
- private Method getMethod(String methodName, Class<?>... parameterTypes) throws Exception {
- return this.getClass().getMethod(methodName, parameterTypes);
- }
-
- public void method0() { /* used by tests */ }
- public void method1(int foo) { /* used by tests */ }
- public void method2(int foo, String bar) { /* used by tests */ }
- public void method3(int foo, String bar, Object[][] baz) { /* used by tests */ }
-
- public void methodA(int foo, String bar) { /* used by tests */ }
- public void methodA(int foo, String bar, String baz) { /* used by tests */ }
-
- public void methodB(int foo, Object bar) { /* used by tests */ }
- public void methodB(int foo, String bar) { /* used by tests */ }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java
deleted file mode 100644
index a389583e0d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-
-@SuppressWarnings("nls")
-public class NameToolsTests extends TestCase {
-
- public NameToolsTests(String name) {
- super(name);
- }
-
- public void testStringAbsentIgnoreCase() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameForIgnoreCase("Taupe", colorCollection);
- assertEquals("Taupe", returned);
- }
-
- public void testStringPresentCaseDiffers() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameFor("green", colorCollection);
- assertEquals("green", returned);
- }
-
- public void testStringPresentIgnoreCase() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameForIgnoreCase("green", colorCollection);
- assertEquals("green2", returned);
- }
-
- public void testStringPresentWithAppendices() {
- List<String> colorCollection = this.buildColorCollection();
- colorCollection.add("Red1");
- colorCollection.add("red2");
- String returned = NameTools.uniqueNameForIgnoreCase("red", colorCollection);
- colorCollection.remove("Red1");
- colorCollection.remove("red2");
- assertEquals("red3", returned);
- }
-
- private List<String> buildColorCollection() {
- List<String> colorCollection = new ArrayList<String>();
- colorCollection.add("Red");
- colorCollection.add("Orange");
- colorCollection.add("Yellow");
- colorCollection.add("Green");
- colorCollection.add("Blue");
- colorCollection.add("Indigo");
- colorCollection.add("Violet");
- return colorCollection;
- }
-
- public void testUniqueNameForCollection1() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle Corporation");
- strings.add("Oracle2");
- strings.add("oracle1");
- strings.add("Oracl");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings));
-
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings));
- }
-
- public void testUniqueNameForCollection2() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings));
-
- strings.add("Oracle Corporation");
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings));
- }
-
- public void testUniqueNameForCollection3() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- }
-
- public void testUniqueNameForIterator1() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle Corporation");
- strings.add("Oracle2");
- strings.add("oracle1");
- strings.add("Oracl");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator()));
-
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator()));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator()));
- }
-
- public void testUniqueNameForIterator2() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator()));
-
- strings.add("Oracle Corporation");
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator()));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator()));
- }
-
- public void testUniqueNameForIterator3() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- }
-
- public void testBuildQualifiedDatabaseObjectName() {
- assertEquals("catalog.schema.name", NameTools.buildQualifiedDatabaseObjectName("catalog", "schema", "name"));
- assertEquals("catalog..name", NameTools.buildQualifiedDatabaseObjectName("catalog", null, "name"));
- assertEquals("schema.name", NameTools.buildQualifiedDatabaseObjectName(null, "schema", "name"));
- assertEquals("name", NameTools.buildQualifiedDatabaseObjectName(null, null, "name"));
- }
-
- public void testJavaReservedWords() {
- assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "class"));
- assertFalse(CollectionTools.contains(NameTools.javaReservedWords(), "Class"));
- assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "private"));
- }
-
- public void testconvertToJavaIdentifierString() {
- assertEquals("foo", NameTools.convertToJavaIdentifier("foo"));
- assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1"));
- assertEquals("private_", NameTools.convertToJavaIdentifier("private"));
- assertEquals("throw_", NameTools.convertToJavaIdentifier("throw"));
- assertEquals("_foo", NameTools.convertToJavaIdentifier("1foo"));
- assertEquals("foo_", NameTools.convertToJavaIdentifier("foo%"));
- assertEquals("foo__bar__", NameTools.convertToJavaIdentifier("foo bar "));
- }
-
- public void testconvertToJavaIdentifierStringChar() {
- assertEquals("foo", NameTools.convertToJavaIdentifier("foo", '$'));
- assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1", '$'));
- assertEquals("private$", NameTools.convertToJavaIdentifier("private", '$'));
- assertEquals("throwss", NameTools.convertToJavaIdentifier("throw", 's'));
- assertEquals("$foo", NameTools.convertToJavaIdentifier("1foo", '$'));
- assertEquals("foo$", NameTools.convertToJavaIdentifier("foo%", '$'));
- assertEquals("foo$$bar$$", NameTools.convertToJavaIdentifier("foo bar ", '$'));
-
- boolean exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("1foo", '7');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('7') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("foo%", '^');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('^') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("private", '^');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('^') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- }
-
- public void testStringIsLegalJavaIdentifier() {
- assertFalse(NameTools.stringIsLegalJavaIdentifier("class"));
- assertTrue(NameTools.stringIsLegalJavaIdentifier("clasS"));
-
- assertFalse(NameTools.stringIsLegalJavaIdentifier("7foo"));
- assertFalse(NameTools.stringIsLegalJavaIdentifier("foo@bar"));
- assertTrue(NameTools.stringIsLegalJavaIdentifier("_foo"));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java
deleted file mode 100644
index d7f2cce428..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Range;
-
-public class RangeTests extends TestCase {
-
- public RangeTests(String name) {
- super(name);
- }
-
- public void testIncludes() {
- Range range = new Range(5, 17);
- assertFalse(range.includes(-55));
- assertFalse(range.includes(0));
- assertFalse(range.includes(4));
- assertTrue(range.includes(5));
- assertTrue(range.includes(6));
- assertTrue(range.includes(16));
- assertTrue(range.includes(17));
- assertFalse(range.includes(18));
- assertFalse(range.includes(200));
- }
-
- public void testEquals() {
- Range range1 = new Range(5, 17);
- Range range2 = new Range(5, 17);
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
-
- range2 = new Range(17, 5);
- assertFalse(range1.equals(range2));
- assertFalse(range2.equals(range1));
- // although they are unequal, they can have the same hash code
- assertEquals(range1.hashCode(), range2.hashCode());
-
- range2 = new Range(5, 15);
- assertFalse(range1.equals(range2));
- assertFalse(range2.equals(range1));
- }
-
- public void testClone() {
- Range range1 = new Range(5, 17);
- Range range2 = range1.clone();
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
- }
-
- public void testSerialization() throws Exception {
- Range range1 = new Range(5, 17);
- Range range2 = TestTools.serialize(range1);
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
deleted file mode 100644
index 7ae00fdc2e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-
-public class ReverseComparatorTests extends TestCase {
- private Comparator<String> naturalReverseComparator;
- private Comparator<String> customComparator;
- private Comparator<String> customReverseComparator;
-
- public ReverseComparatorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.naturalReverseComparator = new ReverseComparator<String>();
- this.customComparator = this.buildCustomComparator();
- this.customReverseComparator = new ReverseComparator<String>(this.customComparator);
- }
-
- private Comparator<String> buildCustomComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- String lower1 = s1.toLowerCase();
- String lower2 = s2.toLowerCase();
- int result = lower1.compareTo(lower2);
- if (result == 0) {
- return s1.compareTo(s2); // use case to differentiate "equal" strings
- }
- return result;
- }
- };
- }
-
- private List<String> buildUnsortedList() {
- List<String> result = new ArrayList<String>();
- result.add("T");
- result.add("Z");
- result.add("Y");
- result.add("M");
- result.add("m");
- result.add("a");
- result.add("B");
- result.add("b");
- result.add("A");
- return result;
- }
-
- private List<String> buildNaturallySortedList() {
- List<String> result = new ArrayList<String>(this.buildUnsortedList());
- Collections.sort(result);
- return result;
- }
-
- private List<String> buildCustomSortedList() {
- List<String> result = new ArrayList<String>(this.buildUnsortedList());
- Collections.sort(result, this.customComparator);
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testNatural() {
- List<String> list = this.buildUnsortedList();
- Collections.sort(list, this.naturalReverseComparator);
- this.verifyList(this.buildNaturallySortedList(), list);
- }
-
- public void testCustom() {
- List<String> list = this.buildUnsortedList();
- Collections.sort(list, this.customReverseComparator);
- this.verifyList(this.buildCustomSortedList(), list);
- }
-
- private void verifyList(List<String> normal, List<String> reverse) {
- int size = normal.size();
- int max = size - 1;
- for (int i = 0; i < size; i++) {
- assertEquals(normal.get(i), reverse.get(max - i));
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java
deleted file mode 100644
index 3f3200b267..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.Association;
-import org.eclipse.jpt.utility.internal.SimpleAssociation;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class SimpleAssociationTests extends TestCase {
- private SimpleAssociation<String, String> assoc;
-
- public static Test suite() {
- return new TestSuite(SimpleAssociationTests.class);
- }
-
- public SimpleAssociationTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.assoc = new SimpleAssociation<String, String>("foo", "bar");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetKey() {
- assertEquals("foo", this.assoc.key());
- }
-
- public void testGetValue() {
- assertEquals("bar", this.assoc.value());
- }
-
- public void testSetValue() {
- assertEquals("bar", this.assoc.value());
- this.assoc.setValue("baz");
- assertEquals("baz", this.assoc.value());
- }
-
- public void testEquals() {
- assertEquals(this.assoc, this.copy(this.assoc));
-
- SimpleAssociation<String, String> assoc2 = new SimpleAssociation<String, String>("foo", "baz");
- assertFalse(this.assoc.equals(assoc2));
-
- assoc2 = new SimpleAssociation<String, String>("fop", "bar");
- assertFalse(this.assoc.equals(assoc2));
- }
-
- public void testHashCode() {
- assertEquals(this.assoc.hashCode(), this.copy(this.assoc).hashCode());
- }
-
- public void testClone() {
- this.verifyClone(this.assoc, this.assoc.clone());
- }
-
- private void verifyClone(Association<String, String> expected, Association<String, String> actual) {
- assertEquals(expected, actual);
- assertNotSame(expected, actual);
- assertEquals(expected.key(), actual.key());
- assertSame(expected.key(), actual.key());
- assertEquals(expected.value(), actual.value());
- assertSame(expected.value(), actual.value());
- }
-
- public void testSerialization() throws Exception {
- @SuppressWarnings("cast")
- Association<String, String> assoc2 = (Association<String, String>) TestTools.serialize(this.assoc);
-
- assertEquals(this.assoc, assoc2);
- assertNotSame(this.assoc, assoc2);
- assertEquals(this.assoc.key(), assoc2.key());
- assertNotSame(this.assoc.key(), assoc2.key());
- assertEquals(this.assoc.value(), assoc2.value());
- assertNotSame(this.assoc.value(), assoc2.value());
- }
-
- private SimpleAssociation<String, String> copy(SimpleAssociation<String, String> sa) {
- return new SimpleAssociation<String, String>(sa.key(), sa.value());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
deleted file mode 100644
index f229797565..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-
-import junit.framework.TestCase;
-
-public class SimpleStackTests extends TestCase {
-
- public SimpleStackTests(String name) {
- super(name);
- }
-
- public void testIsEmpty() {
- Stack<String> stack = new SimpleStack<String>();
- assertTrue(stack.isEmpty());
- stack.push("first");
- assertFalse(stack.isEmpty());
- stack.push("second");
- assertFalse(stack.isEmpty());
- stack.pop();
- assertFalse(stack.isEmpty());
- stack.pop();
- assertTrue(stack.isEmpty());
- }
-
- public void testPushAndPop() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.pop());
- assertEquals(first, stack.pop());
- }
-
- public void testPushAndPeek() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
- }
-
- public void testEmptyStackExceptionPeek() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
-
- boolean exCaught = false;
- try {
- stack.peek();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEmptyStackExceptionPop() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
-
- boolean exCaught = false;
- try {
- stack.pop();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testClone() {
- SimpleStack<String> stack = new SimpleStack<String>();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, stack.clone());
- }
-
- public void testSerialization() throws Exception {
- SimpleStack<String> stack = new SimpleStack<String>();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, TestTools.serialize(stack));
- }
-
- private void verifyClone(Stack<String> original, Stack<String> clone) {
- assertNotSame(original, clone);
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertEquals(original.isEmpty(), clone.isEmpty());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertTrue(original.isEmpty());
- assertEquals(original.isEmpty(), clone.isEmpty());
-
- original.push("fourth");
- assertFalse(original.isEmpty());
- // clone should still be empty
- assertTrue(clone.isEmpty());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
deleted file mode 100644
index 90e333be7f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
+++ /dev/null
@@ -1,1641 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.io.StringWriter;
-import java.io.Writer;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-@SuppressWarnings("nls")
-public class StringToolsTests extends TestCase {
-
- public StringToolsTests(String name) {
- super(name);
- }
-
- private static void assertEquals(String expected, char[] actual) {
- assertEquals(expected, new String(actual));
- }
-
- // ********** padding/truncating **********
-
- public void testPad() {
- assertEquals("fred", StringTools.pad("fred", 4));
- assertEquals("fred ", StringTools.pad("fred", 6));
- boolean exThrown = false;
- try {
- assertEquals("fr", StringTools.pad("fred", 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadCharArray() {
- assertEquals("fred", StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 4));
- assertEquals("fred ", StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 6));
- boolean exThrown = false;
- try {
- assertEquals("fr", StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnWriter() {
- Writer writer;
- writer = new StringWriter();
- StringTools.padOn("fred", 4, writer);
- assertEquals("fred", writer.toString());
-
- writer = new StringWriter();
- StringTools.padOn("fred", 6, writer);
- assertEquals("fred ", writer.toString());
-
- writer = new StringWriter();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, writer);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnStringBuffer() {
- StringBuffer sb;
- sb = new StringBuffer();
- StringTools.padOn("fred", 4, sb);
- assertEquals("fred", sb.toString());
-
- sb = new StringBuffer();
- StringTools.padOn("fred", 6, sb);
- assertEquals("fred ", sb.toString());
-
- sb = new StringBuffer();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnStringBuilder() {
- StringBuilder sb;
- sb = new StringBuilder();
- StringTools.padOn("fred", 4, sb);
- assertEquals("fred", sb.toString());
-
- sb = new StringBuilder();
- StringTools.padOn("fred", 6, sb);
- assertEquals("fred ", sb.toString());
-
- sb = new StringBuilder();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOrTruncate() {
- assertEquals("fred", StringTools.padOrTruncate("fred", 4));
- assertEquals("fred ", StringTools.padOrTruncate("fred", 6));
- assertEquals("fr", StringTools.padOrTruncate("fred", 2));
- }
-
- public void testPadOrTruncateCharArray() {
- assertEquals("fred", StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 4));
- assertEquals("fred ", StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 6));
- assertEquals("fr", StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 2));
- }
-
- public void testPadOrTruncateOnWriter() {
- this.verifyPadOrTruncateOnWriter("fred", "fred", 4);
- this.verifyPadOrTruncateOnWriter("fred ", "fred", 6);
- this.verifyPadOrTruncateOnWriter("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnWriter(String expected, String string, int length) {
- Writer writer = new StringWriter();
- StringTools.padOrTruncateOn(string, length, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testPadOrTruncateOnStringBuffer() {
- this.verifyPadOrTruncateOnStringBuffer("fred", "fred", 4);
- this.verifyPadOrTruncateOnStringBuffer("fred ", "fred", 6);
- this.verifyPadOrTruncateOnStringBuffer("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnStringBuffer(String expected, String string, int length) {
- StringBuffer sb = new StringBuffer();
- StringTools.padOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testPadOrTruncateOnStringBuilder() {
- this.verifyPadOrTruncateOnStringBuilder("fred", "fred", 4);
- this.verifyPadOrTruncateOnStringBuilder("fred ", "fred", 6);
- this.verifyPadOrTruncateOnStringBuilder("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnStringBuilder(String expected, String string, int length) {
- StringBuilder sb = new StringBuilder();
- StringTools.padOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testZeroPad() {
- assertEquals("1234", StringTools.zeroPad("1234", 4));
- assertEquals("001234", StringTools.zeroPad("1234", 6));
- boolean exThrown = false;
- try {
- assertEquals("12", StringTools.zeroPad("1234", 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadCharArray() {
- assertEquals("1234", StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 4));
- assertEquals("001234", StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 6));
- boolean exThrown = false;
- try {
- assertEquals("12", StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnWriter() {
- Writer writer;
- writer = new StringWriter();
- StringTools.zeroPadOn("1234", 4, writer);
- assertEquals("1234", writer.toString());
-
- writer = new StringWriter();
- StringTools.zeroPadOn("1234", 6, writer);
- assertEquals("001234", writer.toString());
-
- writer = new StringWriter();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, writer);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnStringBuffer() {
- StringBuffer sb;
- sb = new StringBuffer();
- StringTools.zeroPadOn("1234", 4, sb);
- assertEquals("1234", sb.toString());
-
- sb = new StringBuffer();
- StringTools.zeroPadOn("1234", 6, sb);
- assertEquals("001234", sb.toString());
-
- sb = new StringBuffer();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnStringBuilder() {
- StringBuilder sb;
- sb = new StringBuilder();
- StringTools.zeroPadOn("1234", 4, sb);
- assertEquals("1234", sb.toString());
-
- sb = new StringBuilder();
- StringTools.zeroPadOn("1234", 6, sb);
- assertEquals("001234", sb.toString());
-
- sb = new StringBuilder();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOrTruncate() {
- assertEquals("1234", StringTools.zeroPadOrTruncate("1234", 4));
- assertEquals("001234", StringTools.zeroPadOrTruncate("1234", 6));
- assertEquals("34", StringTools.zeroPadOrTruncate("1234", 2));
- }
-
- public void testZeroPadOrTruncateCharArray() {
- assertEquals("1234", StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 4));
- assertEquals("001234", StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 6));
- assertEquals("34", StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 2));
- }
-
- public void testZeroPadOrTruncateOnWriter() {
- this.verifyZeroPadOrTruncateOnWriter("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnWriter("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnWriter("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnWriter(String expected, String string, int length) {
- Writer writer = new StringWriter();
- StringTools.zeroPadOrTruncateOn(string, length, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testZeroPadOrTruncateOnStringBuffer() {
- this.verifyZeroPadOrTruncateOnStringBuffer("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnStringBuffer("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnStringBuffer("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnStringBuffer(String expected, String string, int length) {
- StringBuffer sb = new StringBuffer();
- StringTools.zeroPadOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testZeroPadOrTruncateOnStringBuilder() {
- this.verifyZeroPadOrTruncateOnStringBuilder("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnStringBuilder("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnStringBuilder("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnStringBuilder(String expected, String string, int length) {
- StringBuilder sb = new StringBuilder();
- StringTools.zeroPadOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** delimiting **********
-
- public void testDelimit() {
- this.verifyDelimit("Employee", "123", "123Employee123");
- this.verifyDelimit("123", "123", "123123123");
- this.verifyDelimit("", "123", "123123");
- }
-
- private void verifyDelimit(String string, String delimiter, String expectedString) {
- assertEquals(expectedString, StringTools.delimit(string, delimiter));
- }
-
- public void testDelimitOnWriter() {
- this.verifyDelimitOnWriter("Employee", "123", "123Employee123");
- this.verifyDelimitOnWriter("123", "123", "123123123");
- this.verifyDelimitOnWriter("", "123", "123123");
- }
-
- private void verifyDelimitOnWriter(String string, String delimiter, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.delimitOn(string, delimiter, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testDelimitOnStringBuffer() {
- this.verifyDelimitOnStringBuffer("Employee", "123", "123Employee123");
- this.verifyDelimitOnStringBuffer("123", "123", "123123123");
- this.verifyDelimitOnStringBuffer("", "123", "123123");
- }
-
- private void verifyDelimitOnStringBuffer(String string, String delimiter, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.delimitOn(string, delimiter, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testDelimitOnStringBuilder() {
- this.verifyDelimitOnStringBuilder("Employee", "123", "123Employee123");
- this.verifyDelimitOnStringBuilder("123", "123", "123123123");
- this.verifyDelimitOnStringBuilder("", "123", "123123");
- }
-
- private void verifyDelimitOnStringBuilder(String string, String delimiter, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.delimitOn(string, delimiter, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testQuote() {
- this.verifyQuote("Employee", "\"Employee\"");
- this.verifyQuote("123", "\"123\"");
- this.verifyQuote("", "\"\"");
- this.verifyQuote("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuote(String string, String expectedString) {
- assertEquals(expectedString, StringTools.quote(string));
- }
-
- public void testQuoteOnWriter() {
- this.verifyQuoteOnWriter("Employee", "\"Employee\"");
- this.verifyQuoteOnWriter("123", "\"123\"");
- this.verifyQuoteOnWriter("", "\"\"");
- this.verifyQuoteOnWriter("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuoteOnWriter(String string, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.quoteOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testQuoteOnStringBuffer() {
- this.verifyQuoteOnStringBuffer("Employee", "\"Employee\"");
- this.verifyQuoteOnStringBuffer("123", "\"123\"");
- this.verifyQuoteOnStringBuffer("", "\"\"");
- this.verifyQuoteOnStringBuffer("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuoteOnStringBuffer(String string, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.quoteOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testQuoteOnStringBuilder() {
- this.verifyQuoteOnStringBuilder("Employee", "\"Employee\"");
- this.verifyQuoteOnStringBuilder("123", "\"123\"");
- this.verifyQuoteOnStringBuilder("", "\"\"");
- this.verifyQuoteOnStringBuilder("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuoteOnStringBuilder(String string, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.quoteOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- // ********** removing characters **********
-
- public void testRemoveFirstOccurrence() {
- this.verifyRemoveFirstOccurrence("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrence("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrence("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrence("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrence("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrence(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeFirstOccurrence(string, charToRemove));
- }
-
- public void testRemoveFirstOccurrenceCharArray() {
- this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceCharArray("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceCharArray("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceCharArray("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeFirstOccurrence(string.toCharArray(), charToRemove));
- }
-
- public void testRemoveFirstOccurrenceOnWriter() {
- this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnWriter("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnWriter("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnWriter("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveFirstOccurrenceOnStringBuffer() {
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveFirstOccurrenceOnStringBuilder() {
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllOccurrences() {
- this.verifyRemoveAllOccurrences("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrences(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrences("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrences(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrences(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllOccurrences(string, charToRemove));
- }
-
- public void testRemoveAllOccurrencesCharArray() {
- this.verifyRemoveAllOccurrencesCharArray("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesCharArray(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesCharArray("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesCharArray(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllOccurrences(string.toCharArray(), charToRemove));
- }
-
- public void testRemoveAllOccurrencesOnWriter() {
- this.verifyRemoveAllOccurrencesOnWriter("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnWriter(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnWriter("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnWriter(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeAllOccurrencesOn(string, charToRemove, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveAllOccurrencesOnStringBuffer() {
- this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnStringBuffer(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnStringBuffer(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeAllOccurrencesOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllOccurrencesOnStringBuilder() {
- this.verifyRemoveAllOccurrencesOnStringBuilder("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnStringBuilder(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnStringBuilder("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnStringBuilder(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeAllOccurrencesOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllWhitespace() {
- this.verifyRemoveAllWhitespace("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespace("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespace("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespace(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespace(String string, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllWhitespace(string));
- }
-
- public void testRemoveAllWhitespaceCharArray() {
- this.verifyRemoveAllWhitespaceCharArray("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceCharArray("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceCharArray("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceCharArray(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceCharArray(String string, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllWhitespace(string.toCharArray()));
- }
-
- public void testRemoveAllWhitespaceOnWriter() {
- this.verifyRemoveAllWhitespaceOnWriter("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnWriter("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceOnWriter("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnWriter(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnWriter(String string, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeAllWhitespaceOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveAllWhitespaceOnStringBuffer() {
- this.verifyRemoveAllWhitespaceOnStringBuffer("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnStringBuffer("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceOnStringBuffer("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnStringBuffer(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnStringBuffer(String string, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeAllWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllWhitespaceOnStringBuilder() {
- this.verifyRemoveAllWhitespaceOnStringBuilder("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnStringBuilder("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceOnStringBuilder("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnStringBuilder(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnStringBuilder(String string, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeAllWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- // ********** common prefix **********
-
- public void testCommonPrefixLength() {
- assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "fooBBB"));
- assertEquals(3, StringTools.commonPrefixLength("foo", "fooBBB"));
- assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "foo"));
- assertEquals(3, StringTools.commonPrefixLength("foo", "foo"));
- }
-
- public void testCommonPrefixLengthMax() {
- assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "fooBBB", 2));
- assertEquals(2, StringTools.commonPrefixLength("foo", "fooBBB", 2));
- assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "foo", 2));
- assertEquals(2, StringTools.commonPrefixLength("foo", "foo", 2));
- }
-
- // ********** capitalization **********
-
- public void testCapitalizeCharArray() {
- this.verifyCapitalizeCharArray("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeCharArray("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeCharArray("", new char[0]);
- this.verifyCapitalizeCharArray("A", new char[] { 'a' });
- this.verifyCapitalizeCharArray("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeCharArray(String expected, char[] string) {
- assertEquals(expected, StringTools.capitalize(string));
- }
-
- public void testCapitalizeString() {
- this.verifyCapitalizeString("Oracle", "Oracle");
- this.verifyCapitalizeString("Oracle", "oracle");
- this.verifyCapitalizeString(" ", " ");
- this.verifyCapitalizeString("ORACLE", "ORACLE");
- this.verifyCapitalizeString("", "");
- this.verifyCapitalizeString("A", "a");
- this.verifyCapitalizeString("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeString(String expected, String string) {
- assertEquals(expected, StringTools.capitalize(string));
- }
-
- public void testCapitalizeOnCharArrayStringBuffer() {
- this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayStringBuffer("", new char[0]);
- this.verifyCapitalizeOnCharArrayStringBuffer("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayStringBuffer("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayStringBuffer(String expected, char[] string) {
- StringBuffer sb = new StringBuffer();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnCharArrayStringBuilder() {
- this.verifyCapitalizeOnCharArrayStringBuilder("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuilder("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuilder(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayStringBuilder("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayStringBuilder("", new char[0]);
- this.verifyCapitalizeOnCharArrayStringBuilder("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayStringBuilder("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayStringBuilder(String expected, char[] string) {
- StringBuilder sb = new StringBuilder();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnStringStringBuffer() {
- this.verifyCapitalizeOnStringStringBuffer("Oracle", "Oracle");
- this.verifyCapitalizeOnStringStringBuffer("Oracle", "oracle");
- this.verifyCapitalizeOnStringStringBuffer(" ", " ");
- this.verifyCapitalizeOnStringStringBuffer("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringStringBuffer("", "");
- this.verifyCapitalizeOnStringStringBuffer("A", "a");
- this.verifyCapitalizeOnStringStringBuffer("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnStringStringBuilder() {
- this.verifyCapitalizeOnStringStringBuilder("Oracle", "Oracle");
- this.verifyCapitalizeOnStringStringBuilder("Oracle", "oracle");
- this.verifyCapitalizeOnStringStringBuilder(" ", " ");
- this.verifyCapitalizeOnStringStringBuilder("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringStringBuilder("", "");
- this.verifyCapitalizeOnStringStringBuilder("A", "a");
- this.verifyCapitalizeOnStringStringBuilder("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnCharArrayWriter() {
- this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayWriter("", new char[0]);
- this.verifyCapitalizeOnCharArrayWriter("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayWriter("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayWriter(String expected, char[] string) {
- Writer writer = new StringWriter();
- StringTools.capitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testCapitalizeOnStringWriter() {
- this.verifyCapitalizeOnStringWriter("Oracle", "Oracle");
- this.verifyCapitalizeOnStringWriter("Oracle", "oracle");
- this.verifyCapitalizeOnStringWriter(" ", " ");
- this.verifyCapitalizeOnStringWriter("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringWriter("", "");
- this.verifyCapitalizeOnStringWriter("A", "a");
- this.verifyCapitalizeOnStringWriter("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.capitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUnapitalizeCharArray() {
- this.verifyUncapitalizeCharArray("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeCharArray("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeCharArray("", new char[0]);
- this.verifyUncapitalizeCharArray("a", new char[] { 'A' });
- this.verifyUncapitalizeCharArray("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeCharArray(String expected, char[] string) {
- assertEquals(expected, StringTools.uncapitalize(string));
- }
-
- public void testUncapitalizeString() {
- this.verifyUncapitalizeString("oracle", "Oracle");
- this.verifyUncapitalizeString("oracle", "oracle");
- this.verifyUncapitalizeString(" ", " ");
- this.verifyUncapitalizeString("ORACLE", "ORACLE");
- this.verifyUncapitalizeString("", "");
- this.verifyUncapitalizeString("a", "A");
- this.verifyUncapitalizeString("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeString(String expected, String string) {
- assertEquals(expected, StringTools.uncapitalize(string));
- }
-
- public void testUncapitalizeOnCharArrayStringBuffer() {
- this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("", new char[0]);
- this.verifyUncapitalizeOnCharArrayStringBuffer("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayStringBuffer(String expected, char[] string) {
- StringBuffer sb = new StringBuffer();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnCharArrayStringBuilder() {
- this.verifyUncapitalizeOnCharArrayStringBuilder("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuilder(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("", new char[0]);
- this.verifyUncapitalizeOnCharArrayStringBuilder("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayStringBuilder(String expected, char[] string) {
- StringBuilder sb = new StringBuilder();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnStringStringBuffer() {
- this.verifyUncapitalizeOnStringStringBuffer("oracle", "Oracle");
- this.verifyUncapitalizeOnStringStringBuffer("oracle", "oracle");
- this.verifyUncapitalizeOnStringStringBuffer(" ", " ");
- this.verifyUncapitalizeOnStringStringBuffer("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringStringBuffer("", "");
- this.verifyUncapitalizeOnStringStringBuffer("a", "A");
- this.verifyUncapitalizeOnStringStringBuffer("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnStringStringBuilder() {
- this.verifyUncapitalizeOnStringStringBuilder("oracle", "Oracle");
- this.verifyUncapitalizeOnStringStringBuilder("oracle", "oracle");
- this.verifyUncapitalizeOnStringStringBuilder(" ", " ");
- this.verifyUncapitalizeOnStringStringBuilder("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringStringBuilder("", "");
- this.verifyUncapitalizeOnStringStringBuilder("a", "A");
- this.verifyUncapitalizeOnStringStringBuilder("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnCharArrayWriter() {
- this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayWriter("", new char[0]);
- this.verifyUncapitalizeOnCharArrayWriter("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayWriter("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayWriter(String expected, char[] string) {
- Writer writer = new StringWriter();
- StringTools.uncapitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUncapitalizeOnStringWriter() {
- this.verifyUncapitalizeOnStringWriter("oracle", "Oracle");
- this.verifyUncapitalizeOnStringWriter("oracle", "oracle");
- this.verifyUncapitalizeOnStringWriter(" ", " ");
- this.verifyUncapitalizeOnStringWriter("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringWriter("", "");
- this.verifyUncapitalizeOnStringWriter("a", "A");
- this.verifyUncapitalizeOnStringWriter("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.uncapitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- // ********** queries **********
-
- public void testStringIsEmptyString() {
- assertTrue(StringTools.stringIsEmpty((String) null));
- assertTrue(StringTools.stringIsEmpty(""));
- assertTrue(StringTools.stringIsEmpty(" "));
- assertTrue(StringTools.stringIsEmpty(" \t\t "));
- assertTrue(StringTools.stringIsEmpty(" \t\t " + StringTools.CR));
- }
-
- public void testStringIsEmptyCharArray() {
- assertTrue(StringTools.stringIsEmpty((char[]) null));
- this.verifyStringIsEmptyCharArray("");
- this.verifyStringIsEmptyCharArray(" \t\t ");
- this.verifyStringIsEmptyCharArray(" ");
- this.verifyStringIsEmptyCharArray(" \t\t " + StringTools.CR);
- }
-
- private void verifyStringIsEmptyCharArray(String string) {
- assertTrue(StringTools.stringIsEmpty(string.toCharArray()));
- }
-
- public void testStringsAreEqualIgnoreCaseStringString() {
- assertTrue(StringTools.stringsAreEqualIgnoreCase((String) null, (String) null));
- assertFalse(StringTools.stringsAreEqualIgnoreCase(null, "asdf"));
- assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf", null));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "asdf"));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "ASDF"));
- }
-
- public void testStringsAreEqualIgnoreCaseCharArrayCharArray() {
- assertTrue(StringTools.stringsAreEqualIgnoreCase((char[]) null, (char[]) null));
- assertFalse(StringTools.stringsAreEqualIgnoreCase((char[]) null, "asdf".toCharArray()));
- assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), (char[]) null));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "asdf".toCharArray()));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray()));
- }
-
- public void testStringStartsWithIgnoreCaseStringString() {
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "as"));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "aS"));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", ""));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "A"));
-
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "bsdf"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "g"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdg"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfg"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfgggggg"));
- }
-
- public void testStringStartsWithIgnoreCaseCharArrayCharArray() {
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "as".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "aS".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "A".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdf".toCharArray()));
-
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "bsdf".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "g".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdg".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfg".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfgggggg".toCharArray()));
- }
-
- public void testCharactersAreEqualIgnoreCase() {
- assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'a'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'A'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'a'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'A'));
-
- assertFalse(StringTools.charactersAreEqualIgnoreCase('a', 'b'));
- assertFalse(StringTools.charactersAreEqualIgnoreCase('A', 'b'));
- }
-
- public void testStringIsUppercase() {
- this.verifyStringIsUppercase("FOO");
- this.verifyStringIsUppercase("FOO2");
- this.verifyStringIsUppercase("F O O");
- this.denyStringIsUppercase("Foo");
- this.denyStringIsUppercase("");
- }
-
- private void verifyStringIsUppercase(String s) {
- assertTrue(StringTools.stringIsUppercase(s));
- assertTrue(StringTools.stringIsUppercase(s.toCharArray()));
- }
-
- private void denyStringIsUppercase(String s) {
- assertFalse(StringTools.stringIsUppercase(s));
- assertFalse(StringTools.stringIsUppercase(s.toCharArray()));
- }
-
- public void testStringIsLowercase() {
- this.verifyStringIsLowercase("foo");
- this.verifyStringIsLowercase("foo2");
- this.verifyStringIsLowercase("f o o");
- this.denyStringIsLowercase("Foo");
- this.denyStringIsLowercase("");
- }
-
- private void verifyStringIsLowercase(String s) {
- assertTrue(StringTools.stringIsLowercase(s));
- assertTrue(StringTools.stringIsLowercase(s.toCharArray()));
- }
-
- private void denyStringIsLowercase(String s) {
- assertFalse(StringTools.stringIsLowercase(s));
- assertFalse(StringTools.stringIsLowercase(s.toCharArray()));
- }
-
- // ********** convert camel-case to all-caps **********
-
- public void testConvertCamelCaseToAllCaps() {
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test"));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST"));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest"));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest"));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTESTTest"));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest"));
- assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT"));
- }
-
- public void testConvertCamelCaseToAllCapsOnWriter() {
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.convertCamelCaseToAllCapsOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertCamelCaseToAllCapsOnStringBuffer() {
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertCamelCaseToAllCapsOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertCamelCaseToAllCapsOnStringBuilder() {
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.convertCamelCaseToAllCapsOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertCamelCaseToAllCapsMaxLength() {
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 44));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 4));
- assertEquals("TES", StringTools.convertCamelCaseToAllCaps("test", 3));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST", 5));
- assertEquals("TE", StringTools.convertCamelCaseToAllCaps("TEST", 2));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest", 9));
- assertEquals("TEST_TES", StringTools.convertCamelCaseToAllCaps("testTest", 8));
- assertEquals("TEST_T", StringTools.convertCamelCaseToAllCaps("testTest", 6));
- assertEquals("TEST_", StringTools.convertCamelCaseToAllCaps("testTest", 5));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("testTest", 4));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 9));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 1100));
- assertEquals("TEST_TEST_", StringTools.convertCamelCaseToAllCaps("testTESTTest", 10));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest", 14));
- assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 16));
- assertEquals("TEST_TEST_TEST_", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 15));
- }
-
- public void testConvertCamelCaseToAllCapsMaxLengthOnWriter() {
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 44);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TES", "test", 3);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "TEST", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TE", "TEST", 2);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "testTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TES", "testTest", 8);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_T", "testTest", 6);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_", "testTest", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "testTest", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 1100);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_", "testTESTTest", 10);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST", "TestTESTTest", 14);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_T", "TestTESTTestT", 16);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_", "TestTESTTestT", 15);
- }
-
- private void verifyConvertCamelCaseToAllCapsMaxLengthOnWriter(String expected, String string, int max) {
- Writer writer = new StringWriter();
- StringTools.convertCamelCaseToAllCapsOn(string, max, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertCamelCaseToAllCapsMaxLengthOnStringBuffer() {
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "test", 44);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "test", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TES", "test", 3);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "TEST", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TE", "TEST", 2);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "testTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TES", "testTest", 8);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_T", "testTest", 6);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_", "testTest", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "testTest", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "TestTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "TestTest", 1100);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_", "testTESTTest", 10);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST", "TestTESTTest", 14);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST_T", "TestTESTTestT", 16);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST_", "TestTESTTestT", 15);
- }
-
- private void verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer(String expected, String string, int max) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertCamelCaseToAllCapsOn(string, max, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** convert underscores to all-caps **********
-
- public void testConvertUnderscoresToCamelCase() {
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST_", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST____", false));
- assertEquals("Test", StringTools.convertUnderscoresToCamelCase("TEST", true));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TeST", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST___TEST", false));
- assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", true));
- assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", false));
- assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", true));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", false));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", true));
- }
-
- public void testConvertUnderscoresToCamelCaseLowercase() {
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test_", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test____", false));
- assertEquals("Test", StringTools.convertUnderscoresToCamelCase("test", true));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test_test", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test___test", false));
- assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("test_test", true));
- assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", false));
- assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", true));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", false));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", true));
- }
-
- public void testConvertUnderscoresToCamelCaseOnWriter() {
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST_", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST____", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TeST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST___TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "TEST_TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "TEST_TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__TEST_TEST_TEST_T", true);
- }
-
- public void testConvertUnderscoresToCamelCaseOnWriterLowercase() {
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test_", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test____", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test___test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "test_test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "test_test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__test_test_test_t", true);
- }
-
- private void verifyConvertUnderscoresToCamelCaseOnWriter(String expected, String string, boolean capitalizeFirstLetter) {
- Writer writer = new StringWriter();
- StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertUnderscoresToCamelCaseOnStringBuffer() {
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST_", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST____", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("Test", "TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TeST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "TEST___TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTest", "TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTest", "TEST_TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTest", "TEST_TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "_TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "__TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "_TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "__TEST_TEST_TEST_T", true);
- }
-
- public void testConvertUnderscoresToCamelCaseOnStringBufferLowercase() {
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test_", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test____", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("Test", "test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "test___test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTest", "test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTest", "test_test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTest", "test_test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "_test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "__test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "_test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "__test_test_test_t", true);
- }
-
- private void verifyConvertUnderscoresToCamelCaseOnStringBuffer(String expected, String string, boolean capitalizeFirstLetter) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** delimiting **********
-
- public void testStringIsQuoted() {
- this.denyStringIsQuoted("foo");
- this.verifyStringIsQuoted("\"foo\"");
-
- this.denyStringIsQuoted("");
- this.verifyStringIsQuoted("\"\"");
-
- this.denyStringIsQuoted("\"");
- this.denyStringIsQuoted(" ");
- this.denyStringIsQuoted("''");
- this.denyStringIsQuoted("'foo'");
- }
-
- private void verifyStringIsQuoted(String s) {
- assertTrue(StringTools.stringIsQuoted(s));
- assertTrue(StringTools.stringIsQuoted(s.toCharArray()));
- }
-
- private void denyStringIsQuoted(String s) {
- assertFalse(StringTools.stringIsQuoted(s));
- assertFalse(StringTools.stringIsQuoted(s.toCharArray()));
- }
-
- public void testStringIsParenthetical() {
- this.denyStringIsParenthetical("foo");
- this.verifyStringIsParenthetical("(foo)");
-
- this.denyStringIsParenthetical("");
- this.verifyStringIsParenthetical("()");
-
- this.denyStringIsParenthetical("(");
- this.denyStringIsParenthetical(" ");
- this.denyStringIsParenthetical("''");
- this.denyStringIsParenthetical("'foo'");
- }
-
- private void verifyStringIsParenthetical(String s) {
- assertTrue(StringTools.stringIsParenthetical(s));
- assertTrue(StringTools.stringIsParenthetical(s.toCharArray()));
- }
-
- private void denyStringIsParenthetical(String s) {
- assertFalse(StringTools.stringIsParenthetical(s));
- assertFalse(StringTools.stringIsParenthetical(s.toCharArray()));
- }
-
- public void testStringIsBracketed() {
- this.denyStringIsBracketed("foo");
- this.verifyStringIsBracketed("[foo]");
-
- this.denyStringIsBracketed("");
- this.verifyStringIsBracketed("[]");
-
- this.denyStringIsBracketed("[");
- this.denyStringIsBracketed(" ");
- this.denyStringIsBracketed("''");
- this.denyStringIsBracketed("'foo'");
- }
-
- private void verifyStringIsBracketed(String s) {
- assertTrue(StringTools.stringIsBracketed(s));
- assertTrue(StringTools.stringIsBracketed(s.toCharArray()));
- }
-
- private void denyStringIsBracketed(String s) {
- assertFalse(StringTools.stringIsBracketed(s));
- assertFalse(StringTools.stringIsBracketed(s.toCharArray()));
- }
-
- public void testStringIsBraced() {
- this.denyStringIsBraced("foo");
- this.verifyStringIsBraced("{foo}");
-
- this.denyStringIsBraced("");
- this.verifyStringIsBraced("{}");
-
- this.denyStringIsBraced("{");
- this.denyStringIsBraced(" ");
- this.denyStringIsBraced("''");
- this.denyStringIsBraced("'foo'");
- }
-
- private void verifyStringIsBraced(String s) {
- assertTrue(StringTools.stringIsBraced(s));
- assertTrue(StringTools.stringIsBraced(s.toCharArray()));
- }
-
- private void denyStringIsBraced(String s) {
- assertFalse(StringTools.stringIsBraced(s));
- assertFalse(StringTools.stringIsBraced(s.toCharArray()));
- }
-
- public void testStringIsChevroned() {
- this.denyStringIsChevroned("foo");
- this.verifyStringIsChevroned("<foo>");
-
- this.denyStringIsChevroned("");
- this.verifyStringIsChevroned("<>");
-
- this.denyStringIsChevroned("{");
- this.denyStringIsChevroned(" ");
- this.denyStringIsChevroned("''");
- this.denyStringIsChevroned("'foo'");
- }
-
- private void verifyStringIsChevroned(String s) {
- assertTrue(StringTools.stringIsChevroned(s));
- assertTrue(StringTools.stringIsChevroned(s.toCharArray()));
- }
-
- private void denyStringIsChevroned(String s) {
- assertFalse(StringTools.stringIsChevroned(s));
- assertFalse(StringTools.stringIsChevroned(s.toCharArray()));
- }
-
- public void testStringIsDelimited() {
- this.denyStringIsDelimited("foo", '?');
- this.verifyStringIsDelimited("?foo?", '?');
-
- this.denyStringIsDelimited("", '?');
- this.verifyStringIsDelimited("\"\"", '"');
- this.verifyStringIsDelimited("?xx?", '?');
- this.denyStringIsDelimited("?xx]", '?');
-
- this.denyStringIsDelimited("\"", '"');
- this.denyStringIsDelimited(" ", ' ');
- this.denyStringIsDelimited("''", '"');
- this.denyStringIsDelimited("'foo'", '?');
- }
-
- private void verifyStringIsDelimited(String s, char c) {
- assertTrue(StringTools.stringIsDelimited(s, c));
- assertTrue(StringTools.stringIsDelimited(s.toCharArray(), c));
- }
-
- private void denyStringIsDelimited(String s, char c) {
- assertFalse(StringTools.stringIsDelimited(s, c));
- assertFalse(StringTools.stringIsDelimited(s.toCharArray(), c));
- }
-
- public void testStringIsDelimited2() {
- this.denyStringIsDelimited2("foo", '[', ']');
- this.verifyStringIsDelimited2("{foo}", '{', '}');
-
- this.denyStringIsDelimited2("", '[', ']');
- this.verifyStringIsDelimited2("[]", '[', ']');
- this.verifyStringIsDelimited2("[xx]", '[', ']');
- this.denyStringIsDelimited2("?xx]", '[', ']');
-
- this.denyStringIsDelimited2("\"", '[', ']');
- this.denyStringIsDelimited2(" ", '[', ']');
- this.denyStringIsDelimited2("''", '[', ']');
- this.denyStringIsDelimited2("'foo'", '[', ']');
- }
-
- private void verifyStringIsDelimited2(String s, char start, char end) {
- assertTrue(StringTools.stringIsDelimited(s, start, end));
- assertTrue(StringTools.stringIsDelimited(s.toCharArray(), start, end));
- }
-
- private void denyStringIsDelimited2(String s, char start, char end) {
- assertFalse(StringTools.stringIsDelimited(s, start, end));
- assertFalse(StringTools.stringIsDelimited(s.toCharArray(), start, end));
- }
-
- // ********** undelimiting **********
-
- public void testUndelimit() {
- this.verifyUndelimit("\"foo\"", "foo");
- this.verifyUndelimit("\"\"", "");
- this.verifyUndelimit("'foo'", "foo");
- this.verifyUndelimit("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimit("\"foo\"\"\"", "foo\"");
- this.verifyUndelimit("\"\"\"foo\"", "\"foo");
- this.verifyUndelimit("[foo]", "foo");
- this.verifyUndelimit("\"\"\"", "\"");
- this.verifyUndelimit("\"foo\"bar\"", "foo\"");
- this.verifyUndelimit("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimit(String s, String expected) {
- assertEquals(expected, StringTools.undelimit(s));
- assertEquals(expected, StringTools.undelimit(s.toCharArray()));
- }
-
- public void testUndelimitInt() {
- this.verifyUndelimitInt("\"foo\"", 2, "o");
- this.verifyUndelimitInt("\"\"foo\"\"", 2, "foo");
- this.verifyUndelimitInt("'foo'", 2, "o");
- }
-
- private void verifyUndelimitInt(String s, int count, String expected) {
- assertEquals(expected, StringTools.undelimit(s, count));
- assertEquals(expected, StringTools.undelimit(s.toCharArray(), count));
- }
-
- public void testUndelimitIntException() {
- this.denyUndelimitInt("\"\"", 2);
- this.denyUndelimitInt("'o'", 2);
- }
-
- private void denyUndelimitInt(String s, int count) {
- boolean exCaught = false;
- try {
- String bogus = StringTools.undelimit(s, count);
- fail("invalid string: " + bogus);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- char[] bogus = StringTools.undelimit(s.toCharArray(), count);
- fail("invalid string: " + new String(bogus));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUndelimitOnWriter() {
- this.verifyUndelimitOnWriter("\"foo\"", "foo");
- this.verifyUndelimitOnWriter("\"\"", "");
- this.verifyUndelimitOnWriter("'foo'", "foo");
- this.verifyUndelimitOnWriter("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimitOnWriter("\"foo\"\"\"", "foo\"");
- this.verifyUndelimitOnWriter("\"\"\"foo\"", "\"foo");
- this.verifyUndelimitOnWriter("[foo]", "foo");
- this.verifyUndelimitOnWriter("\"\"\"", "\"");
- this.verifyUndelimitOnWriter("\"foo\"bar\"", "foo\"");
- this.verifyUndelimitOnWriter("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimitOnWriter(String s, String expected) {
- Writer writer = new StringWriter();
- StringTools.undelimitOn(s, writer);
- assertEquals(expected, writer.toString());
-
- writer = new StringWriter();
- StringTools.undelimitOn(s.toCharArray(), writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUndelimitOnStringBuffer() {
- this.verifyUndelimitOnStringBuffer("\"foo\"", "foo");
- this.verifyUndelimitOnStringBuffer("\"\"", "");
- this.verifyUndelimitOnStringBuffer("'foo'", "foo");
- this.verifyUndelimitOnStringBuffer("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimitOnStringBuffer("\"foo\"\"\"", "foo\"");
- this.verifyUndelimitOnStringBuffer("\"\"\"foo\"", "\"foo");
- this.verifyUndelimitOnStringBuffer("[foo]", "foo");
- this.verifyUndelimitOnStringBuffer("\"\"\"", "\"");
- this.verifyUndelimitOnStringBuffer("\"foo\"bar\"", "foo\"");
- this.verifyUndelimitOnStringBuffer("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimitOnStringBuffer(String s, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.undelimitOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuffer();
- StringTools.undelimitOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUndelimitOnStringBuilder() {
- this.verifyUndelimitOnStringBuilder("\"foo\"", "foo");
- this.verifyUndelimitOnStringBuilder("\"\"", "");
- this.verifyUndelimitOnStringBuilder("'foo'", "foo");
- this.verifyUndelimitOnStringBuilder("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimitOnStringBuilder("\"foo\"\"\"", "foo\"");
- this.verifyUndelimitOnStringBuilder("\"\"\"foo\"", "\"foo");
- this.verifyUndelimitOnStringBuilder("[foo]", "foo");
- this.verifyUndelimitOnStringBuilder("\"\"\"", "\"");
- this.verifyUndelimitOnStringBuilder("\"foo\"bar\"", "foo\"");
- this.verifyUndelimitOnStringBuilder("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimitOnStringBuilder(String s, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.undelimitOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuilder();
- StringTools.undelimitOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUndelimitOnWriterCount() {
- this.verifyUndelimitOnWriterCount("\"foo\"", 2, "o");
- this.verifyUndelimitOnWriterCount("\"\"\"\"", 2, "");
- this.verifyUndelimitOnWriterCount("XXfooXX", 2, "foo");
- }
-
- private void verifyUndelimitOnWriterCount(String s, int count, String expected) {
- Writer writer = new StringWriter();
- StringTools.undelimitOn(s, count, writer);
- assertEquals(expected, writer.toString());
-
- writer = new StringWriter();
- StringTools.undelimitOn(s.toCharArray(), count, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUndelimitOnStringBufferCount() {
- this.verifyUndelimitOnStringBufferCount("\"foo\"", 2, "o");
- this.verifyUndelimitOnStringBufferCount("\"\"\"\"", 2, "");
- this.verifyUndelimitOnStringBufferCount("XXfooXX", 2, "foo");
- }
-
- private void verifyUndelimitOnStringBufferCount(String s, int count, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.undelimitOn(s, count, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuffer();
- StringTools.undelimitOn(s.toCharArray(), count, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUndelimitOnStringBuilderCount() {
- this.verifyUndelimitOnStringBuilderCount("\"foo\"", 2, "o");
- this.verifyUndelimitOnStringBuilderCount("\"\"\"\"", 2, "");
- this.verifyUndelimitOnStringBuilderCount("XXfooXX", 2, "foo");
- }
-
- private void verifyUndelimitOnStringBuilderCount(String s, int count, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.undelimitOn(s, count, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuilder();
- StringTools.undelimitOn(s.toCharArray(), count, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** converting to Java string literal **********
-
- public void testConvertToJavaStringLiteral() {
- this.verifyConvertToJavaStringLiteral("", "\"\"");
- this.verifyConvertToJavaStringLiteral("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteral("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteral("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteral("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteral("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteral("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteral(String s, String expected) {
- assertEquals(expected, StringTools.convertToJavaStringLiteral(s));
- assertEquals(expected, StringTools.convertToJavaStringLiteral(s.toCharArray()));
- }
-
- public void testConvertToJavaStringLiteralOnStringBuffer() {
- this.verifyConvertToJavaStringLiteralOnStringBuffer("", "\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteralOnStringBuffer(String s, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertToJavaStringLiteralOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuffer();
- StringTools.convertToJavaStringLiteralOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertToJavaStringLiteralOnStringBuilder() {
- this.verifyConvertToJavaStringLiteralOnStringBuilder("", "\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteralOnStringBuilder(String s, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.convertToJavaStringLiteralOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuilder();
- StringTools.convertToJavaStringLiteralOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertToJavaStringLiteralOnWriter() {
- this.verifyConvertToJavaStringLiteralOnWriter("", "\"\"");
- this.verifyConvertToJavaStringLiteralOnWriter("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteralOnWriter("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteralOnWriter(String s, String expected) {
- Writer writer = new StringWriter();
- StringTools.convertToJavaStringLiteralOn(s, writer);
- assertEquals(expected, writer.toString());
-
- writer = new StringWriter();
- StringTools.convertToJavaStringLiteralOn(s.toCharArray(), writer);
- assertEquals(expected, writer.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java
deleted file mode 100644
index 4b42839081..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-import junit.framework.TestCase;
-
-public class SynchronizedBooleanTests extends TestCase {
- private volatile SynchronizedBoolean sb;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- private volatile long startTime;
- private volatile long endTime;
-
-
- public SynchronizedBooleanTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.sb = new SynchronizedBoolean();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAccessors() throws Exception {
- this.sb.setValue(false);
- assertFalse(this.sb.value());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
-
- this.sb.setValue(true);
- assertTrue(this.sb.value());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
-
- this.sb.setFalse();
- assertFalse(this.sb.value());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
-
- this.sb.setTrue();
- assertTrue(this.sb.value());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
-
- assertSame(this.sb, this.sb.mutex());
- }
-
- public void testEquals() throws Exception {
- this.sb.setValue(false);
- SynchronizedBoolean sb2 = new SynchronizedBoolean(false);
- assertEquals(this.sb, sb2);
-
- this.sb.setValue(true);
- assertFalse(this.sb.equals(sb2));
-
- sb2.setValue(true);
- assertEquals(this.sb, sb2);
- }
-
- public void testHashCode() {
- this.sb.setValue(false);
- assertEquals(0, this.sb.hashCode());
-
- this.sb.setValue(true);
- assertEquals(1, this.sb.hashCode());
- }
-
- public void testWaitUntilTrue() throws Exception {
- this.verifyWaitUntilTrue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to true by t2
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitUntilTrueTimeout() throws Exception {
- this.verifyWaitUntilTrue(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitUntilTrue(long timeout) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(this.buildSetTrueCommand(), this.sb, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitUntilTrueCommand(timeout), this.sb, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- public void testWaitToSetFalse() throws Exception {
- this.verifyWaitToSetFalse(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to false by t2
- assertFalse(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToSetFalseTimeout() throws Exception {
- this.verifyWaitToSetFalse(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToSetFalse(long timeout) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(this.buildSetTrueCommand(), this.sb, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToSetFalseCommand(timeout), this.sb, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- private Command buildSetTrueCommand() {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) {
- syncBool.setTrue();
- }
- };
- }
-
- private Command buildWaitUntilTrueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws Exception {
- SynchronizedBooleanTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedBooleanTests.this.setTimeoutOccurred( ! syncBool.waitUntilTrue(timeout));
- SynchronizedBooleanTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildWaitToSetFalseCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws Exception {
- SynchronizedBooleanTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedBooleanTests.this.setTimeoutOccurred( ! syncBool.waitToSetFalse(timeout));
- SynchronizedBooleanTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedBoolean syncBool, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(syncBool);
- } catch (Exception ex) {
- SynchronizedBooleanTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedBoolean syncBool) throws Exception;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
deleted file mode 100644
index e673aa2f42..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.SynchronizedObject;
-
-import junit.framework.TestCase;
-
-public class SynchronizedObjectTests extends TestCase {
- private volatile SynchronizedObject<Object> so;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- volatile Object value = new Object();
- private volatile long startTime;
- private volatile long endTime;
- private volatile Object soValue;
-
-
- public SynchronizedObjectTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.so = new SynchronizedObject<Object>();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.soValue = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAccessors() throws Exception {
- this.so.setValue(null);
- assertNull(this.so.value());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- this.so.setValue(this.value);
- assertEquals(this.value, this.so.value());
- assertTrue(this.so.isNotNull());
- assertFalse(this.so.isNull());
-
- this.so.setNull();
- assertNull(this.so.value());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- assertSame(this.so, this.so.mutex());
- }
-
- public void testEquals() throws Exception {
- this.so.setValue(null);
- SynchronizedObject<Object> so2 = new SynchronizedObject<Object>(null);
- assertEquals(this.so, so2);
-
- this.so.setValue(this.value);
- assertFalse(this.so.equals(so2));
-
- so2.setValue(this.value);
- assertEquals(this.so, so2);
- }
-
- public void testHashCode() {
- this.so.setValue(this.value);
- assertEquals(this.value.hashCode(), this.so.hashCode());
-
- this.so.setValue(null);
- assertEquals(0, this.so.hashCode());
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to null
- */
- public void testWaitUntilNull() throws Exception {
- this.verifyWaitUntilNull(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to null by t2
- assertNull(this.so.value());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 150): " + time, time > 150);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitUntilNullTimeout() throws Exception {
- this.verifyWaitUntilNull(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertNull(this.so.value());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < 150): " + time, time < 150);
- }
-
- private void verifyWaitUntilNull(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetNullCommand(), this.buildWaitUntilNullCommand(t2Timeout));
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to null;
- * then t2 will set the value to an object
- */
- public void testWaitToSetValue() throws Exception {
- this.verifyWaitToSetValue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to an object by t2
- assertTrue(this.so.isNotNull());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 150): " + time, time > 150);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitToSetValueTimeout() throws Exception {
- this.verifyWaitToSetValue(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertTrue(this.so.isNull());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < 150): " + time, time < 150);
- }
-
- private void verifyWaitToSetValue(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetNullCommand(), this.buildWaitToSetValueCommand(t2Timeout));
- }
-
- /**
- * t2 will wait until t1 is finished "initializing" the value;
- * then t2 will get the newly-initialized value ("foo")
- */
- public void testExecute() throws Exception {
- this.so.setValue(null);
- Runnable r1 = this.buildRunnable(this.buildInitializeValueCommand(), this.so, 0);
- // give t1 a head start of 100 ms
- Runnable r2 = this.buildRunnable(this.buildGetValueCommand(), this.so, 100);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- assertEquals("foo", this.so.value());
- assertEquals("foo", this.soValue);
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 100): " + time, time > 300);
- }
-
- private void executeThreads(Command t1Command, Command t2Command) throws Exception {
- this.so.setValue(this.value);
- Runnable r1 = this.buildRunnable(t1Command, this.so, 200);
- Runnable r2 = this.buildRunnable(t2Command, this.so, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- private Command buildSetNullCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) {
- sObject.setNull();
- }
- };
- }
-
- private Command buildWaitUntilNullCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setTimeoutOccurred( ! sObject.waitUntilNull(timeout));
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildWaitToSetValueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setTimeoutOccurred( ! sObject.waitToSetValue(SynchronizedObjectTests.this.value, timeout));
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildInitializeValueCommand() {
- return new Command() {
- public void execute(final SynchronizedObject<Object> sObject) throws Exception {
- sObject.execute(
- new org.eclipse.jpt.utility.Command() {
- public void execute() {
- // pretend to perform some long initialization process
- try {
- Thread.sleep(500);
- } catch (Exception ex) {
- SynchronizedObjectTests.this.setExCaught(true);
- }
- sObject.setValue("foo");
- }
- }
- );
- }
- };
- }
-
- private Command buildGetValueCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setSOValue(sObject.value());
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedObject<Object> sObject, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(sObject);
- } catch (Exception ex) {
- SynchronizedObjectTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- private long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
- void setSOValue(Object soValue) {
- this.soValue = soValue;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedObject<Object> so) throws Exception;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java
deleted file mode 100644
index adb83d9f83..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-import org.eclipse.jpt.utility.internal.SynchronizedStack;
-
-public class SynchronizedStackTests extends SimpleStackTests {
- private volatile SynchronizedStack<String> ss;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- private volatile long startTime;
- private volatile long endTime;
- private volatile Object poppedObject;
-
- static final String ITEM_1 = new String();
- static final String ITEM_2 = new String();
-
- public SynchronizedStackTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.ss = new SynchronizedStack<String>();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.poppedObject = null;
- }
-
- /**
- * test first with an unsynchronized stack,
- * then with a synchronized stack
- */
- public void testConcurrentAccess() throws Exception {
- this.verifyConcurrentAccess(new SlowSimpleStack<String>(), "second");
- this.verifyConcurrentAccess(new SlowSynchronizedStack<String>(), "first");
- }
-
- private void verifyConcurrentAccess(SlowStack<String> slowStack, String expected) throws Exception {
- slowStack.push("first");
- slowStack.push("second");
-
- new Thread(this.buildRunnable(slowStack)).start();
- Thread.sleep(200);
-
- assertEquals(expected, slowStack.pop());
- }
-
- private Runnable buildRunnable(final SlowStack<String> slowStack) {
- return new Runnable() {
- public void run() {
- slowStack.slowPop();
- }
- };
- }
-
-
- private interface SlowStack<E> extends Stack<E> {
- Object slowPop();
- }
-
- private class SlowSimpleStack<E> extends SimpleStack<E> implements SlowStack<E> {
- SlowSimpleStack() {
- super();
- }
- public Object slowPop() {
- try {
- Thread.sleep(500);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.pop();
- }
-
- }
-
- private class SlowSynchronizedStack<E> extends SynchronizedStack<E> implements SlowStack<E> {
- SlowSynchronizedStack() {
- super();
- }
- public synchronized Object slowPop() {
- try {
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.pop();
- }
-
- }
-
-
- // ********** waits **********
-
- public void testWaitToPop() throws Exception {
- this.verifyWaitToPop(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and an item should have been popped by t2...
- assertSame(ITEM_1, this.poppedObject);
- // ...and the stack should be empty
- assertTrue(this.ss.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToPopTimeout() throws Exception {
- this.verifyWaitToPop(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the stack was never popped...
- assertNull(this.poppedObject);
- // ...and it still holds the item
- assertSame(ITEM_1, this.ss.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToPop(long timeout) throws Exception {
- Runnable r1 = this.buildRunnable(this.buildPushCommand(), this.ss, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToPopCommand(timeout), this.ss, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- public void testWaitToPush() throws Exception {
- this.verifyWaitToPush(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the stack gets popped by t1...
- assertSame(ITEM_1, this.poppedObject);
- // ...and an item is pushed on to the stack by t2
- assertFalse(this.ss.isEmpty());
- assertSame(ITEM_2, this.ss.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToPushTimeout() throws Exception {
- this.verifyWaitToPush(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the stack is eventually popped by t1...
- assertSame(ITEM_1, this.poppedObject);
- // ...but nothing is pushed on to the stack by t2
- assertTrue(this.ss.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToPush(long timeout) throws Exception {
- this.ss.push(ITEM_1);
- Runnable r1 = this.buildRunnable(this.buildPopCommand(), this.ss, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToPushCommand(timeout), this.ss, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- private Command buildPushCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- synchronizedStack.push(ITEM_1);
- }
- };
- }
-
- private Command buildWaitToPopCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws Exception {
- SynchronizedStackTests.this.setStartTime(System.currentTimeMillis());
- try {
- SynchronizedStackTests.this.setPoppedObject(synchronizedStack.waitToPop(timeout));
- } catch (EmptyStackException ex) {
- SynchronizedStackTests.this.setTimeoutOccurred(true);
- }
- SynchronizedStackTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildPopCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- SynchronizedStackTests.this.setPoppedObject(synchronizedStack.pop());
- }
- };
- }
-
- private Command buildWaitToPushCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws Exception {
- SynchronizedStackTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedStackTests.this.setTimeoutOccurred( ! synchronizedStack.waitToPush(ITEM_2, timeout));
- SynchronizedStackTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedStack<String> synchronizedStack, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(synchronizedStack);
- } catch (Exception ex) {
- SynchronizedStackTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- void setPoppedObject(Object poppedObject) {
- this.poppedObject = poppedObject;
- }
-
- long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedStack<String> synchronizedStack) throws Exception;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
deleted file mode 100644
index 57fe19877c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import junit.framework.TestCase;
-import junit.framework.TestFailure;
-import junit.framework.TestResult;
-
-/**
- * various tools that can be used by test cases
- */
-public final class TestTools {
-
- /**
- * test an object's implementation of Serializable by serializing the
- * specified object to a byte array; then de-serializing the byte array and
- * returning the resultant object
- */
- public static <T> T serialize(T o) throws IOException, ClassNotFoundException {
- ByteArrayOutputStream baOutStream = new ByteArrayOutputStream(2000);
- ObjectOutputStream outStream = new ObjectOutputStream(baOutStream);
- outStream.writeObject(o);
- outStream.close();
-
- ByteArrayInputStream baInStream = new ByteArrayInputStream(baOutStream.toByteArray());
- ObjectInputStream inStream = new ObjectInputStream(baInStream);
- T o2 = readObject(inStream);
- inStream.close();
-
- return o2;
- }
-
- @SuppressWarnings("unchecked")
- private static <T> T readObject(ObjectInput objectInput) throws IOException, ClassNotFoundException {
- return (T) objectInput.readObject();
- }
-
- /**
- * redirect std out and std err to the specified stream
- */
- public static void redirectSystemStreamsTo(OutputStream outputStream) {
- redirectSystemStreamsTo(new PrintStream(outputStream));
- }
-
- /**
- * redirect std out and std err to the specified stream
- */
- public static void redirectSystemStreamsTo(PrintStream printStream) {
- System.setOut(printStream);
- System.setErr(printStream);
- }
-
- /**
- * execute the specified test and dump the results to the console
- */
- public static String execute(TestCase testCase) {
- long start = System.currentTimeMillis();
- TestResult result = testCase.run();
- long end = System.currentTimeMillis();
-
- StringWriter stringWriter = new StringWriter();
- PrintWriter writer = new PrintWriter(stringWriter);
- writer.print(testCase.getName());
- writer.print(": ");
- if (result.wasSuccessful()) {
- writer.println("OK");
- } else {
- TestFailure failure = null;
- if (result.failures().hasMoreElements()) {
- failure = (TestFailure) result.failures().nextElement();
- } else {
- failure = (TestFailure) result.errors().nextElement();
- }
- failure.thrownException().printStackTrace(writer);
- }
- writer.print("elapsed time: ");
- long elapsed = end - start;
- writer.print(elapsed / 1000L);
- writer.println(" sec.");
- return stringWriter.toString();
- }
-
- private static final Class<TestCase> TestCase_class = TestCase.class;
-
- /**
- * Clear out all the instance variable of the specified test case, allowing
- * the various test fixtures to be garbage-collected. Typically this is
- * called in the #tearDown() method.
- */
- public static void clear(TestCase testCase) throws IllegalAccessException {
- for (Class<?> tempClass = testCase.getClass(); tempClass != TestCase_class; tempClass = tempClass.getSuperclass()) {
- Field[] fields = tempClass.getDeclaredFields();
- for (int i = fields.length; i-- > 0;) {
- Field field = fields[i];
- // leave primitives alone - they don't get garbage-collected, and we can't set them to null...
- if (field.getType().isPrimitive()) {
- continue;
- }
- // leave static fields alone (?)
- if (Modifier.isStatic(field.getModifiers())) {
- continue;
- }
- field.setAccessible(true);
- field.set(testCase, null);
- }
- }
- }
-
- /**
- * Workaround for a JUnit bug: JUnit does not configure the testing Thread
- * with a context class loader. This should probably happen in
- * TestRunner.doRunTest(Test), just before starting the thread.
- */
- public static void setUpJUnitThreadContextClassLoader() {
- Thread.currentThread().setContextClassLoader(TestTools.class.getClassLoader());
- }
-
- private TestTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java
deleted file mode 100644
index 3b104b9b89..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.FileTools;
-import org.eclipse.jpt.utility.internal.XMLStringEncoder;
-
-public class XMLStringEncoderTests extends TestCase {
-
- public XMLStringEncoderTests(String name) {
- super(name);
- }
-
- public void testEncodeNoCharacterSequences() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "foo";
- assertEquals(s, encoder.encode(s));
-
- s = "123foo123";
- assertEquals(s, encoder.encode(s));
- }
-
- public void testEncodeCharacterSequences() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "?foo?";
- String expected = "&#x3f;foo&#x3f;";
- assertEquals(expected, encoder.encode(s));
-
- s = "?foo&123";
- expected = "&#x3f;foo&#x26;123";
- assertEquals(expected, encoder.encode(s));
- }
-
- public void testDenormalizeValidFileName() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "foo";
- assertEquals(s, encoder.decode(s));
-
- s = "123foo123";
- assertEquals(s, encoder.decode(s));
- }
-
- public void testDenormalizeInvalidFileName() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "&#x3f;foo&#x3f;";
- String expected = "?foo?";
- assertEquals(expected, encoder.decode(s));
-
- s = "&#x3f;foo&#x26;123";
- expected = "?foo&123";
- assertEquals(expected, encoder.decode(s));
- }
-
- public void testRoundTripNoCharacterSequences() {
- this.verifyRoundTrip("foo");
- this.verifyRoundTrip("123foo456");
- }
-
- public void testRoundTripCharacterSequences() {
- this.verifyRoundTrip("?foo?");
- this.verifyRoundTrip("?foo&123&&&&&&>>>>");
- }
-
- private void verifyRoundTrip(String s) {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- String actual = encoder.encode(s);
- assertEquals(s, encoder.decode(actual));
- }
-
- public void testInvalidCharacterSequence1() {
- this.verifyIllegalStateException("foo&");
- }
-
- public void testInvalidCharacterSequence2() {
- this.verifyIllegalStateException("foo&#");
- }
-
- public void testInvalidCharacterSequence3() {
- this.verifyIllegalStateException("foo&#x");
- }
-
- public void testInvalidCharacterSequence4() {
- this.verifyIllegalStateException("foo&#x3");
- }
-
- public void testInvalidCharacterSequence5() {
- this.verifyIllegalStateException("foo&#x;");
- }
-
- public void testInvalidCharacterSequence6() {
- this.verifyIllegalStateException("foo&A");
- }
-
- public void testInvalidCharacterSequence7() {
- this.verifyIllegalStateException("foo&#A");
- }
-
- private void verifyIllegalStateException(String s) {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- boolean exCaught = false;
- try {
- s = encoder.decode(s);
- fail(s);
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidCharacterSequence8() {
- String s = "foo&#xZZZZ;";
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- boolean exCaught = false;
- try {
- s = encoder.decode(s);
- fail(s);
- } catch (NumberFormatException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java
deleted file mode 100644
index d2309c351c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class ArrayIteratorTests extends TestCase {
-
- public ArrayIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildArray().length, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus element", ++i, Integer.parseInt(stream.next()));
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalArgumentException() {
- this.triggerIllegalArgumentException(-1, 1);
- this.triggerIllegalArgumentException(8, 1);
- this.triggerIllegalArgumentException(0, -1);
- this.triggerIllegalArgumentException(0, 9);
- }
-
- public void testGenerics() {
- Integer[] integers = new Integer[3];
- integers[0] = new Integer(0);
- integers[1] = new Integer(1);
- integers[2] = new Integer(2);
- int i = 0;
- for (Iterator<Number> stream = new ArrayIterator<Number>(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = new ArrayIterator<Number>(new Integer(0), new Integer(1), new Integer(2)); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- public void triggerIllegalArgumentException(int start, int length) {
- boolean exCaught = false;
- Iterator<String> stream = null;
- try {
- stream = this.buildIterator(start, length);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown: " + stream, exCaught);
- }
-
- Iterator<String> buildIterator() {
- return this.buildIterator(this.buildArray());
- }
-
- Iterator<String> buildIterator(String[] array) {
- return new ArrayIterator<String>(array);
- }
-
- Iterator<String> buildIterator(int start, int length) {
- return this.buildIterator(this.buildArray(), start, length);
- }
-
- Iterator<String> buildIterator(String[] array, int start, int length) {
- return new ArrayIterator<String>(array, start, length);
- }
-
- String[] buildArray() {
- return new String[] { "1", "2", "3", "4", "5", "6", "7", "8" };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java
deleted file mode 100644
index 2ccab87bb4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-public class ArrayListIteratorTests extends ArrayIteratorTests {
-
- public ArrayListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasPrevious() {
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- int i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(this.buildArray().length, i);
- }
-
- public void testPrevious() {
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- int i = this.buildArray().length;
- while (stream.hasPrevious()) {
- assertEquals("bogus element", i--, Integer.parseInt(stream.previous()));
- }
- }
-
- public void testNextIndex() {
- int i = 0;
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- assertEquals(i, stream.nextIndex());
- stream.next();
- i++;
- }
- assertEquals(i, stream.nextIndex());
- }
-
- public void testPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- assertEquals(i - 1, stream.previousIndex());
- stream.next();
- i++;
- }
- assertEquals(i - 1, stream.previousIndex());
- }
-
- @Override
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildListIterator();
- String string = null;
- try {
- string = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationExceptionAdd() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildListIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.add("3.5");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testUnsupportedOperationExceptionSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildListIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.set("three");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- public void testGenerics() {
- Integer[] integers = new Integer[3];
- integers[0] = new Integer(0);
- integers[1] = new Integer(1);
- integers[2] = new Integer(2);
- int i = 0;
- for (Iterator<Number> stream = new ArrayListIterator<Number>(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- @Override
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = new ArrayListIterator<Number>(new Integer(0), new Integer(1), new Integer(2)); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- private ListIterator<String> buildListIterator() {
- return this.buildListIterator(this.buildArray());
- }
-
- private ListIterator<String> buildListIterator(String[] array) {
- return new ArrayListIterator<String>(array);
- }
-
- @Override
- Iterator<String> buildIterator(String[] array) {
- return new ArrayListIterator<String>(array);
- }
-
- @Override
- Iterator<String> buildIterator(String[] array, int start, int length) {
- return new ArrayListIterator<String>(array, start, length);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
deleted file mode 100644
index 18b3db2669..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.AbstractCollection;
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-
-public class ChainIteratorTests extends TestCase {
- private final static Class<?>[] VECTOR_HIERARCHY = { Vector.class, AbstractList.class, AbstractCollection.class, Object.class };
-
- public ChainIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(VECTOR_HIERARCHY.length, i);
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(VECTOR_HIERARCHY.length, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext(); i++) {
- assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next());
- }
- }
-
- public void testInnerNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildInnerIterator(); stream.hasNext(); i++) {
- assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Class<?>> stream = this.buildIterator();
- Class<?> javaClass = null;
- while (stream.hasNext()) {
- javaClass = stream.next();
- }
- try {
- javaClass = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + javaClass, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next() == AbstractCollection.class) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<Class<?>> buildIterator() {
- return this.buildChainIterator(Vector.class, this.buildLinker());
- }
-
- private Iterator<Class<?>> buildInnerIterator() {
- return this.buildInnerChainIterator(Vector.class);
- }
-
- private Iterator<Class<?>> buildChainIterator(Class<?> startLink, ChainIterator.Linker<Class<?>> linker) {
- return new ChainIterator<Class<?>>(startLink, linker);
- }
-
- private ChainIterator.Linker<Class<?>> buildLinker() {
- // chain up the class's hierarchy
- return new ChainIterator.Linker<Class<?>>() {
- public Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
- private Iterator<Class<?>> buildInnerChainIterator(Class<?> startLink) {
- // chain up the class's hierarchy
- return new ChainIterator<Class<?>>(startLink) {
- @Override
- protected Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
- public void testInvalidChainIterator() {
- // missing method override
- Iterator<Class<?>> iterator = new ChainIterator<Class<?>>(Vector.class);
- boolean exCaught = false;
- try {
- Class<?> c = iterator.next();
- fail("invalid class: " + c.getName());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java
deleted file mode 100644
index e3afdb585f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CloneIteratorTests extends TestCase {
- Collection<String> originalCollection;
-
- private boolean concurrentProblem;
- private Collection<String> concurrentCollection;
-
- public CloneIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalCollection = this.buildCollection();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext() {
- int originalSize = this.originalCollection.size();
- int i = 0;
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- stream.next();
- // should allow concurrent modification
- this.originalCollection.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalCollection.size());
- assertEquals(originalSize, i);
- }
-
- public void testNext() {
- Iterator<String> nestedIterator = this.originalCollection.iterator();
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildCloneIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemoveDefault() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testRemoveEliminator() {
- CloneIterator.Mutator<String> eliminator = new CloneIterator.Mutator<String>() {
- public void remove(String current) {
- CloneIteratorTests.this.originalCollection.remove(current);
- }
- };
- this.verifyRemove(new CloneIterator<String>(this.originalCollection, eliminator));
- }
-
- public void testRemoveSubclass() {
- this.verifyRemove(new CloneIterator<String>(this.originalCollection) {
- @Override
- protected void remove(String current) {
- CloneIteratorTests.this.originalCollection.remove(current);
- }
- });
- }
-
- /**
- * Test concurrent access: First build a clone iterator in a separate thread
- * that hangs momentarily during its construction; then modify the shared
- * collection in this thread. This would cause a
- * ConcurrentModificationException in the other thread if the clone iterator
- * were not synchronized on the original collection.
- */
- public void testConcurrentAccess() throws Exception {
- SlowCollection<String> slow = new SlowCollection<String>();
- this.populateCollection(slow);
- // using the unsynchronized collection will cause the test to fail
- // this.originalCollection = slow;
- this.originalCollection = Collections.synchronizedCollection(slow);
-
- this.concurrentProblem = false;
- this.concurrentCollection = new ArrayList<String>();
- Thread thread = new Thread(this.buildRunnable());
- thread.start();
- while (!slow.hasStartedClone()) {
- // wait for the other thread to start the clone...
- Thread.yield();
- }
- // ...then sneak in an extra element
- this.originalCollection.add("seventeen");
- while (thread.isAlive()) {
- // wait for the other thread to finish
- Thread.yield();
- }
- assertFalse(this.concurrentProblem);
- Collection<String> expected = new ArrayList<String>();
- this.populateCollection(expected);
- assertEquals(expected, this.concurrentCollection);
- }
-
- private Runnable buildRunnable() {
- return new Runnable() {
- public void run() {
- CloneIteratorTests.this.loopWithCloneIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneIterator() {
- try {
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- this.concurrentCollection.add(stream.next());
- }
- } catch (Throwable t) {
- this.concurrentProblem = true;
- }
- }
-
- private void verifyRemove(Iterator<String> iterator) {
- Object removed = "three";
- assertTrue(this.originalCollection.contains(removed));
- // try to remove before calling #next()
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- while (iterator.hasNext()) {
- if (iterator.next().equals(removed)) {
- iterator.remove();
- // try to remove twice
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- }
- assertFalse(this.originalCollection.contains(removed));
- }
-
- private Iterator<String> buildCloneIterator() {
- return this.buildCloneIterator(this.originalCollection);
- }
-
- private Iterator<String> buildCloneIterator(Collection<String> c) {
- return new CloneIterator<String>(c);
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = this.buildEmptyCollection();
- this.populateCollection(c);
- return c;
- }
-
- protected Collection<String> buildEmptyCollection() {
- return new ArrayList<String>();
- }
-
- private void populateCollection(Collection<String> c) {
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- c.add("six");
- c.add("seven");
- c.add("eight");
- }
-
- // ********** custom collection **********
- static class SlowCollection<E> extends ArrayList<E> {
- private static final long serialVersionUID = 1L;
- private boolean hasStartedClone = false;
-
- public SlowCollection() {
- super();
- }
-
- @Override
- public Object[] toArray() {
- this.setHasStartedClone(true);
- // take a little snooze before returning the array
- try {
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return super.toArray();
- }
-
- synchronized void setHasStartedClone(boolean hasStartedClone) {
- this.hasStartedClone = hasStartedClone;
- }
-
- synchronized boolean hasStartedClone() {
- return this.hasStartedClone;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
deleted file mode 100644
index c6045a9f12..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CloneListIteratorTests extends TestCase {
- List<String> originalList;
-
- private boolean concurrentProblem;
- private List<String> concurrentList;
-
- public CloneListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalList = this.buildList();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext() {
- int originalSize = this.originalList.size();
- int i = 0;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- stream.next();
- // should allow concurrent modification
- this.originalList.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalList.size());
- assertEquals(originalSize, i);
- }
-
- public void testNext() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- }
-
- public void testIndex() {
- ListIterator<String> cloneListIterator = this.buildCloneListIterator();
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- for (int i = 0; i < 7; i++) {
- nestedListIterator.next();
- cloneListIterator.next();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
-
- for (int i = 0; i < 3; i++) {
- nestedListIterator.previous();
- cloneListIterator.previous();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
-
- while (nestedListIterator.hasNext()) {
- nestedListIterator.next();
- cloneListIterator.next();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
- }
-
- public void testHasPrevious() {
- int originalSize = this.originalList.size();
- int i = 0;
- ListIterator<String> stream = this.buildCloneListIterator();
- while (stream.hasNext()) {
- stream.next();
- this.originalList.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalList.size());
- originalSize = this.originalList.size();
- while (stream.hasPrevious()) {
- stream.previous();
- // should allow concurrent modification
- this.originalList.add("bar");
- i--;
- }
- assertTrue(originalSize != this.originalList.size());
- assertEquals(0, i);
- }
-
- public void testPrevious() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildCloneListIterator();
- while (stream.hasNext()) {
- nestedListIterator.next();
- stream.next();
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildCloneListIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
-
- exCaught = false;
- while (stream.hasPrevious()) {
- string = stream.previous();
- }
- try {
- string = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testModifyDefault() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
-
- exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.add("three and a half");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
-
- exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.set("another three");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testModifyMutatorNext() {
- this.verifyModifyNext(new CloneListIterator<String>(this.originalList, this.buildMutator()));
- }
-
- public void testModifyMutatorPrevious() {
- this.verifyModifyPrevious(new CloneListIterator<String>(this.originalList, this.buildMutator()));
- }
-
- private CloneListIterator.Mutator<String> buildMutator() {
- return new CloneListIterator.Mutator<String>() {
- public void add(int index, String o) {
- CloneListIteratorTests.this.originalList.add(index, o);
- }
-
- public void remove(int index) {
- CloneListIteratorTests.this.originalList.remove(index);
- }
-
- public void set(int index, String o) {
- CloneListIteratorTests.this.originalList.set(index, o);
- }
- };
- }
-
- public void testModifySubclassNext() {
- this.verifyModifyNext(this.buildSubclass());
- }
-
- public void testModifySubclassPrevious() {
- this.verifyModifyPrevious(this.buildSubclass());
- }
-
- private ListIterator<String> buildSubclass() {
- return new CloneListIterator<String>(this.originalList) {
- @Override
- protected void add(int currentIndex, String o) {
- CloneListIteratorTests.this.originalList.add(currentIndex, o);
- }
-
- @Override
- protected void remove(int currentIndex) {
- CloneListIteratorTests.this.originalList.remove(currentIndex);
- }
-
- @Override
- protected void set(int currentIndex, String o) {
- CloneListIteratorTests.this.originalList.set(currentIndex, o);
- }
- };
- }
-
- private void verifyModifyNext(ListIterator<String> iterator) {
- String removed = "three";
- String addedAfter = "five";
- String added = "five and a half";
- String replaced = "seven";
- String replacement = "another seven";
- assertTrue(this.originalList.contains(removed));
- assertTrue(this.originalList.contains(addedAfter));
- assertTrue(this.originalList.contains(replaced));
- // try to remove before calling #next()
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- while (iterator.hasNext()) {
- String next = iterator.next();
- if (next.equals(addedAfter)) {
- iterator.add(added);
- }
- if (next.equals(removed)) {
- iterator.remove();
- // try to remove twice
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- if (next.equals(replaced)) {
- iterator.set(replacement);
- }
- }
- assertTrue(this.originalList.contains(added));
- assertFalse(this.originalList.contains(removed));
- assertFalse(this.originalList.contains(replaced));
- assertTrue(this.originalList.contains(replacement));
- }
-
- private void verifyModifyPrevious(ListIterator<String> iterator) {
- String removed = "three";
- String addedBefore = "five";
- String added = "four and a half";
- String replaced = "seven";
- String replacement = "another seven";
- assertTrue(this.originalList.contains(removed));
- assertTrue(this.originalList.contains(addedBefore));
- assertTrue(this.originalList.contains(replaced));
- while (iterator.hasNext()) {
- iterator.next();
- }
- while (iterator.hasPrevious()) {
- Object previous = iterator.previous();
- if (previous.equals(addedBefore)) {
- iterator.add(added);
- }
- if (previous.equals(removed)) {
- iterator.remove();
- // try to remove twice
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- if (previous.equals(replaced)) {
- iterator.set(replacement);
- }
- }
- assertTrue(this.originalList.contains(added));
- assertFalse(this.originalList.contains(removed));
- assertFalse(this.originalList.contains(replaced));
- assertTrue(this.originalList.contains(replacement));
- }
-
- private ListIterator<String> buildCloneListIterator() {
- return this.buildCloneListIterator(this.originalList);
- }
-
- private ListIterator<String> buildCloneListIterator(List<String> list) {
- return new CloneListIterator<String>(list);
- }
-
- private ListIterator<String> buildNestedListIterator() {
- return this.originalList.listIterator();
- }
-
- private List<String> buildList() {
- List<String> list = this.buildEmptyList();
- this.populateList(list);
- return list;
- }
-
- private void populateList(List<String> list) {
- list.add("zero");
- list.add("one");
- list.add("two");
- list.add("three");
- list.add("four");
- list.add("five");
- list.add("six");
- list.add("seven");
- list.add("eight");
- list.add("nine");
- }
-
- protected List<String> buildEmptyList() {
- return new ArrayList<String>();
- }
-
- /**
- * Test concurrent access: First build a clone iterator in a separate thread
- * that hangs momentarily during its construction; then modify the shared
- * collection in this thread. This would cause a
- * ConcurrentModificationException in the other thread if the clone iterator
- * were not synchronized on the original collection.
- */
- public void testConcurrentAccess() throws Exception {
- CloneIteratorTests.SlowCollection<String> slow = new CloneIteratorTests.SlowCollection<String>();
- this.populateList(slow);
- // using the unsynchronized list will cause the test to fail
- // this.originalList = slow;
- this.originalList = Collections.synchronizedList(slow);
-
- this.concurrentProblem = false;
- this.concurrentList = new ArrayList<String>();
- Thread thread = new Thread(this.buildRunnable());
- thread.start();
- while (!slow.hasStartedClone()) {
- // wait for the other thread to start the clone...
- Thread.yield();
- }
- // ...then sneak in an extra element
- this.originalList.add("seventeen");
- while (thread.isAlive()) {
- // wait for the other thread to finish
- Thread.yield();
- }
- assertFalse(this.concurrentProblem);
- List<String> expected = new ArrayList<String>();
- this.populateList(expected);
- assertEquals(expected, this.concurrentList);
- }
-
- private Runnable buildRunnable() {
- return new Runnable() {
- public void run() {
- CloneListIteratorTests.this.loopWithCloneListIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneListIterator() {
- try {
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- this.concurrentList.add(stream.next());
- }
- } catch (Throwable t) {
- this.concurrentProblem = true;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
deleted file mode 100644
index 58c3976076..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-
-public class CompositeIteratorTests extends TestCase {
-
- public CompositeIteratorTests(String name) {
- super(name);
- }
-
- public void testHasAnother() {
- this.verifyHasAnother(this.buildCompositeIterator());
- }
-
- public void testHasAnother2() {
- this.verifyHasAnother(this.buildCompositeIterator2());
- }
-
- public void testHasAnother3() {
- this.verifyHasAnother(this.buildCompositeIterator3());
- }
-
- void verifyHasAnother(Iterator<String> stream) {
- this.verifyHasAnother(8, stream);
- }
-
- void verifyHasAnother(int expected, Iterator<String> stream) {
- int i = 0;
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(expected, i);
- }
-
- public void testAnother() {
- this.verifyAnother(this.buildCompositeIterator());
- }
-
- public void testAnother2() {
- this.verifyAnother(this.buildCompositeIterator2());
- }
-
- public void testAnother3() {
- this.verifyAnother(this.buildCompositeIterator3());
- }
-
- void verifyAnother(Iterator<String> stream) {
- this.verifyAnother(1, stream);
- }
-
- void verifyAnother(int start, Iterator<String> stream) {
- int index = start;
- while (stream.hasNext()) {
- assertEquals("bogus element", String.valueOf(index++), stream.next().substring(0, 1));
- }
- }
-
- public void testRemove() {
- this.verifyRemove();
- }
-
- protected void verifyRemove() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- Iterator<String> stream = this.buildCompositeIterator(list.listIterator());
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.remove();
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to remove from the previous iterator
- stream.remove();
- }
- }
- stream.remove();
-
- assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size());
- assertFalse("element still in collection 1", list1.contains("333"));
- assertFalse("last element still in collection 1", list1.contains(lastElement1));
- assertTrue("wrong element removed from collection 1", list1.contains("22"));
-
- assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size());
- assertFalse("element still in collection 3", list3.contains("88888888"));
- assertTrue("wrong element removed from collection 3", list3.contains("666666"));
- }
-
- public void testSingleElement() {
- String item = "0";
- this.verifyHasAnother(9, this.buildCompositeIterator(item, this.buildCompositeIterator()));
- this.verifyAnother(0, this.buildCompositeIterator(item, this.buildCompositeIterator()));
- }
-
- public void testNoSuchElementException() {
- this.verifyNoSuchElementException(this.buildCompositeIterator());
- }
-
- void verifyNoSuchElementException(Iterator<String> stream) {
- boolean exCaught = false;
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- this.verifyUnsupportedOperationException(this.buildUnmodifiableCompositeIterator());
- }
-
- void verifyUnsupportedOperationException(Iterator<String> stream) {
- boolean exCaught = false;
- while (stream.hasNext()) {
- Object string = stream.next();
- if (string.equals("333")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- this.verifyIllegalStateException();
- }
-
- void verifyIllegalStateException() {
- this.verifyIllegalStateException(this.buildCompositeIterator());
- }
-
- void verifyIllegalStateException(Iterator<String> stream) {
- boolean exCaught = false;
- try {
- stream.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- public void testEmptyHasAnother1() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator1());
- }
-
- void verifyEmptyHasAnother(Iterator<String> stream) {
- int i = 0;
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testEmptyNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyIllegalStateException1() {
- this.verifyEmptyIllegalStateException1();
- }
-
- void verifyEmptyIllegalStateException1() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyHasAnother2() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyIllegalStateException2() {
- this.verifyEmptyIllegalStateException2();
- }
-
- void verifyEmptyIllegalStateException2() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator2());
- }
-
- Iterator<String> buildCompositeIterator() {
- return this.buildCompositeIterator(this.buildIterators());
- }
-
- Iterator<String> buildEmptyCompositeIterator1() {
- return this.buildCompositeIterator(this.buildEmptyIterators1());
- }
-
- Iterator<String> buildEmptyCompositeIterator2() {
- return this.buildCompositeIterator(this.buildEmptyIterators2());
- }
-
- Iterator<String> buildUnmodifiableCompositeIterator() {
- return this.buildCompositeIterator(this.buildUnmodifiableIterators());
- }
-
- // leave unchecked so we can override in subclass
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new CompositeIterator<String>(iterators);
- }
-
- // use vararg constructor
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new CompositeIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- // use vararg constructor
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new CompositeIterator<String>(new Iterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- Iterator<String> buildCompositeIterator(String string, Iterator<String> iterator) {
- return new CompositeIterator<String>(string, iterator);
- }
-
- ListIterator<Iterator<String>> buildIterators() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildIterator1());
- list.add(this.buildIterator2());
- list.add(this.buildIterator3());
- return list.listIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIterators1() {
- return this.buildEmptyIteratorIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIterators2() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildEmptyStringIterator());
- list.add(this.buildEmptyStringIterator());
- list.add(this.buildEmptyStringIterator());
- return list.listIterator();
- }
-
- ListIterator<Iterator<String>> buildUnmodifiableIterators() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildUnmodifiableIterator1());
- list.add(this.buildUnmodifiableIterator2());
- list.add(this.buildUnmodifiableIterator3());
- return list.listIterator();
- }
-
- ListIterator<String> buildIterator1() {
- return this.buildList1().listIterator();
- }
-
- ListIterator<String> buildIterator2() {
- return this.buildList2().listIterator();
- }
-
- ListIterator<String> buildIterator3() {
- return this.buildList3().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator1() {
- return this.buildUnmodifiableList1().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator2() {
- return this.buildUnmodifiableList2().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator3() {
- return this.buildUnmodifiableList3().listIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIteratorIterator() {
- return (new ArrayList<Iterator<String>>()).listIterator();
- }
-
- ListIterator<String> buildEmptyStringIterator() {
- return (new ArrayList<String>()).listIterator();
- }
-
- List<String> buildList1() {
- List<String> list = new ArrayList<String>();
- list.add("1");
- list.add("22");
- list.add("333");
- list.add("4444");
- return list;
- }
-
- List<String> buildList2() {
- return new ArrayList<String>();
- }
-
- List<String> buildList3() {
- List<String> list = new ArrayList<String>();
- list.add("55555");
- list.add("666666");
- list.add("7777777");
- list.add("88888888");
- return list;
- }
-
- List<String> buildUnmodifiableList1() {
- return Collections.unmodifiableList(this.buildList1());
- }
-
- List<String> buildUnmodifiableList2() {
- return Collections.unmodifiableList(this.buildList2());
- }
-
- List<String> buildUnmodifiableList3() {
- return Collections.unmodifiableList(this.buildList3());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
deleted file mode 100644
index 2d2bdbec7a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-
-public class CompositeListIteratorTests extends ReadOnlyCompositeListIteratorTests {
-
- public CompositeListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- public void testRemove() {
- super.testRemove();
- List<String> list1 = this.buildList1();
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- // position to end of stream
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (previous.equals("333")) {
- stream.remove();
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.remove();
- }
- }
- stream.remove();
-
- assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size());
- assertFalse("element still in collection 1", list1.contains("1"));
- assertFalse("element still in collection 1", list1.contains("333"));
-
- assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size());
- assertFalse("first element still in collection 3", list3.contains(firstElement3));
- assertTrue("wrong element removed from collection 3", list3.contains("666666"));
- }
-
- public void testAdd() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.add("3.5");
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to add to the iterator
- stream.add("something in 3");
- }
- }
- stream.add("finale");
- boolean checkForFinale = true;
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (checkForFinale) {
- checkForFinale = false;
- assertEquals("added element dropped", "finale", previous);
- }
- if (previous.equals("333")) {
- stream.add("2.5");
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.add("old start of 3");
- }
- }
- stream.add("prelude");
- assertEquals("added element dropped", "prelude", stream.previous());
-
- assertEquals("elements not added to collection 1", this.buildList1().size() + 3, list1.size());
- assertEquals("element not added to collection 1", "prelude", list1.get(0));
- assertEquals("element not added to collection 1", "2.5", list1.get(3));
- assertEquals("element not added to collection 1", "3.5", list1.get(5));
-
- assertEquals("elements not added to collection 3", this.buildList3().size() + 3, list3.size());
- assertEquals("element not added to collection 3", "something in 3", list3.get(0));
- assertEquals("element not added to collection 3", "old start of 3", list3.get(1));
- assertEquals("element not added to collection 3", "finale", list3.get(list3.size() - 1));
-
- // add to the front
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- stream.previous();
- }
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- stream.previous();
- }
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- // add to the middle
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.next();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.next();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.previous();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.previous();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- // add to the end
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.hasNext());
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
- }
-
- public void testSet() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- // position to end of stream
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.set("333a");
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to remove from the previous iterator
- stream.set("end of 1");
- }
- }
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (previous.equals("22")) {
- stream.set("22a");
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.set("start of 3");
- }
- }
-
- assertEquals("element(s) added to collection 1", this.buildList1().size(), list1.size());
- assertEquals("element not set in collection 1", "22a", list1.get(1));
- assertFalse("element not set in collection 1", list1.contains("22"));
- assertEquals("element not set in collection 1", "333a", list1.get(2));
- assertFalse("element not set in collection 1", list1.contains("333"));
- assertEquals("element not set in collection 1", "end of 1", list1.get(list1.size() - 1));
- assertFalse("element not set in collection 1", list1.contains(lastElement1));
-
- assertEquals("element(s) added to collection 3", this.buildList3().size(), list3.size());
- assertEquals("element not set in collection 3", "start of 3", list3.get(0));
- assertFalse("element not set in collection 3", list3.contains(firstElement3));
- }
-
- @Override
- public void testNextIndexPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator();
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasNext()) {
- Object next = stream.next();
- i++;
- if (next.equals("333")) {
- stream.remove();
- i--;
- }
- if (next.equals("7777777")) {
- stream.add("7.5");
- i++;
- }
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 8, i);
-
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- i--;
- if (previous.equals("666666")) {
- stream.remove();
- // removing a previous element, does not change the cursor
- }
- if (previous.equals("22")) {
- stream.add("1.5");
- i++;
- }
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 0, i);
- }
-
- @Override
- public void testIllegalStateException() {
- this.verifyIllegalStateException();
- }
-
- @Override
- public void testEmptyIllegalStateException1() {
- this.verifyEmptyIllegalStateException1();
- }
-
- @Override
- public void testEmptyIllegalStateException2() {
- this.verifyEmptyIllegalStateException2();
- }
-
- // unchecked so we can override the unchecked method in superclass
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new CompositeListIterator<String>((ListIterator<ListIterator<String>>) iterators);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new CompositeListIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new CompositeListIterator<String>(new ListIterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- @Override
- ListIterator<String> buildCompositeListIterator(String string, ListIterator<String> iterator) {
- return new CompositeListIterator<String>(string, iterator);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java
deleted file mode 100644
index 98697897b7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration;
-
-public class EmptyEnumerationTests extends TestCase {
-
- public EmptyEnumerationTests(String name) {
- super(name);
- }
-
- public void testHasMoreElements() {
- int i = 0;
- for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNextElement() {
- for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) {
- fail("bogus element: " + stream.nextElement());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Enumeration<Object> stream = EmptyEnumeration.instance();
- Object element = null;
- while (stream.hasMoreElements()) {
- element = stream.nextElement();
- }
- try {
- element = stream.nextElement();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java
deleted file mode 100644
index 6985ad4ffa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class EmptyIteratorTests extends TestCase {
-
- public EmptyIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Object> stream = EmptyIterator.instance(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNext() {
- for (Iterator<String> stream = EmptyIterator.instance(); stream.hasNext();) {
- fail("bogus element: " + stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Number> stream = EmptyIterator.instance();
- Object element = null;
- while (stream.hasNext()) {
- element = stream.next();
- }
- try {
- element = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- try {
- EmptyIterator.instance().remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java
deleted file mode 100644
index 35c8efc011..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-public class EmptyListIteratorTests extends TestCase {
-
- public EmptyListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (ListIterator<Object> stream = EmptyListIterator.instance(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNext() {
- for (ListIterator<Object> stream = EmptyListIterator.instance(); stream.hasNext();) {
- fail("bogus element: " + stream.next());
- }
- }
-
- public void testNextIndex() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- assertEquals(0, stream.nextIndex());
- }
-
- public void testHasPrevious() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- int i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(0, i);
-
- while (stream.hasNext()) {
- stream.next();
- }
- i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testPrevious() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- while (stream.hasPrevious()) {
- fail("bogus element: " + stream.previous());
- }
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- fail("bogus element: " + stream.previous());
- }
- }
-
- public void testPreviousIndex() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- assertEquals(-1, stream.previousIndex());
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<Object> stream = EmptyListIterator.instance();
- Object element = null;
- while (stream.hasNext()) {
- element = stream.next();
- }
- try {
- element = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown (next): " + element, exCaught);
- while (stream.hasPrevious()) {
- element = stream.previous();
- }
- try {
- element = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown (previous): " + element, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- try {
- EmptyListIterator.instance().remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (remove)", exCaught);
- try {
- EmptyListIterator.instance().set(new Object());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (set)", exCaught);
- try {
- EmptyListIterator.instance().add(new Object());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (add)", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java
deleted file mode 100644
index 528f101110..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EnumerationIterator;
-
-public class EnumerationIteratorTests extends TestCase {
-
- public EnumerationIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNext() {
- Enumeration<String> enumeration = this.buildEnumeration();
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus element", enumeration.nextElement(), stream.next());
- }
- }
-
- public void testNextUpcast() {
- Enumeration<String> enumeration = this.buildEnumeration();
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus element", enumeration.nextElement(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<String> buildIterator() {
- return this.buildIterator(this.buildEnumeration());
- }
-
- private Iterator<String> buildIterator(Enumeration<String> enumeration) {
- return new EnumerationIterator<String>(enumeration);
- }
-
- private Enumeration<String> buildEnumeration() {
- return this.buildVector().elements();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
- private Iterator<Object> buildIteratorUpcast() {
- return this.buildIteratorUpcast(this.buildEnumeration());
- }
-
- private Iterator<Object> buildIteratorUpcast(Enumeration<String> enumeration) {
- return new EnumerationIterator<Object>(enumeration);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
deleted file mode 100644
index fe498aab9f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.SimpleFilter;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-public class FilteringIteratorTests extends TestCase {
-
- private static final String PREFIX = "prefix";
-
- public FilteringIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- String string = stream.next();
- if (string.equals(PREFIX + "3")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildAcceptIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testAcceptHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testAcceptNext() {
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testInnerNext() {
- for (Iterator<String> stream = this.buildInnerIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testRejectHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildRejectIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(2, i);
- }
-
- public void testRejectNext() {
- for (Iterator<String> stream = this.buildRejectIterator(); stream.hasNext();) {
- assertFalse("bogus reject", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testBothHasNext() {
- // if both accept() and reject() are overridden, accept() is used
- int i = 0;
- for (Iterator<String> stream = this.buildBothIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testLoadNext() {
- // loadNext() used to cause a NPE when executing during the
- // constructor because the "outer" class is not bound until completion
- // of the constructor
- for (Iterator<String> stream = this.buildInnerIterator2(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- // test a filtered iterator with a nested iterator of a sub-type (Number vs. Integer)
- public void testGenerics1() {
- List<Integer> integers = new ArrayList<Integer>();
- integers.add(new Integer(0));
- integers.add(new Integer(1));
- integers.add(new Integer(2));
- integers.add(new Integer(3));
- Iterator<Number> stream = new FilteringIterator<Integer, Number>(integers.iterator()) {
- @Override
- protected boolean accept(Integer o) {
- return o.intValue() > 1;
- }
- };
- assertEquals(2, CollectionTools.size(stream));
- }
-
- // test a filtered iterator with a nested iterator of a super-type (Integer vs. Number)
- // i.e. trust that Filter will only return the appropriate sub-type objects
- public void testGenerics2() {
- List<Number> numbers = new ArrayList<Number>();
- numbers.add(new Integer(0));
- numbers.add(new Long(1));
- numbers.add(new Integer(2));
- numbers.add(new Float(3));
- Iterator<Integer> stream = new FilteringIterator<Number, Integer>(numbers.iterator()) {
- @Override
- protected boolean accept(Number o) {
- return o instanceof Integer;
- }
- };
- assertEquals(2, CollectionTools.size(stream));
- }
-
- public void testFilterHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildFilterIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testFilterNext() {
- for (Iterator<String> stream = this.buildFilterIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- private Iterator<String> buildFilteredIterator(Iterator<String> nestedIterator, Filter<String> filter) {
- return new FilteringIterator<String, String>(nestedIterator, filter);
- }
-
- private Iterator<String> buildInnerFilteredIterator(Iterator<String> nestedIterator) {
- return new FilteringIterator<String, String>(nestedIterator) {
- @Override
- protected boolean accept(String s) {
- return s.startsWith(PREFIX);
- }
- };
- }
-
- String getPrefix() {
- return PREFIX;
- }
-
- // this inner iterator will call the "outer" object
- private Iterator<String> buildInnerFilteredIterator2(Iterator<String> nestedIterator) {
- return new FilteringIterator<String, String>(nestedIterator) {
- @Override
- protected boolean accept(String s) {
- return s.startsWith(FilteringIteratorTests.this.getPrefix());
- }
- };
- }
-
- private Iterator<String> buildNestedIterator() {
- Collection<String> c = new ArrayList<String>();
- c.add(PREFIX + "1");
- c.add(PREFIX + "2");
- c.add(PREFIX + "3");
- c.add("4");
- c.add(PREFIX + "5");
- c.add(PREFIX + "6");
- c.add(PREFIX + "7");
- c.add("8");
- return c.iterator();
- }
-
- private Iterator<String> buildAcceptIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildAcceptFilter(PREFIX));
- }
-
- private Iterator<String> buildInnerIterator() {
- return this.buildInnerFilteredIterator(this.buildNestedIterator());
- }
-
- // this inner iterator will call the "outer" object
- private Iterator<String> buildInnerIterator2() {
- return this.buildInnerFilteredIterator2(this.buildNestedIterator());
- }
-
- private Iterator<String> buildFilterIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildFilterFilter(PREFIX));
- }
-
- private Filter<String> buildAcceptFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean accept(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- private Iterator<String> buildRejectIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildRejectFilter(PREFIX));
- }
-
- private Filter<String> buildRejectFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean reject(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- // use anonymous inner Filter
- private Filter<String> buildFilterFilter(final String prefix) {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith(prefix);
- }
- };
- }
-
- private Iterator<String> buildBothIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildBothFilter(PREFIX));
- }
-
- private Filter<String> buildBothFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean reject(String s) {
- return s.startsWith(this.criterion);
- }
-
- @Override
- public boolean accept(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- public void testInvalidFilteringIterator() {
- boolean exCaught = false;
- try {
- // missing method override
- Iterator<String> iterator = new FilteringIterator<String, String>(this.buildNestedIterator());
- String s = iterator.next();
- fail("invalid string: " + s);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
deleted file mode 100644
index 8048a2f10c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.GraphIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class GraphIteratorTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<GraphNode> nodes = new ArrayList<GraphNode>();
-
- public GraphIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext1() {
- this.verifyHasNext(this.buildGraphIterator1());
- }
-
- public void testHasNext2() {
- this.verifyHasNext(this.buildGraphIterator2());
- }
-
- private void verifyHasNext(Iterator<GraphNode> iterator) {
- int i = 0;
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(this.nodes.size(), i);
- }
-
- public void testNext1() {
- this.verifyNext(this.buildGraphIterator1());
- }
-
- public void testNext2() {
- this.verifyNext(this.buildGraphIterator2());
- }
-
- private void verifyNext(Iterator<GraphNode> iterator) {
- while (iterator.hasNext()) {
- assertTrue("bogus element", this.nodes.contains(iterator.next()));
- }
- }
-
- public void testNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildGraphIterator1());
- }
-
- public void testNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildGraphIterator2());
- }
-
- private void verifyNoSuchElementException(Iterator<GraphNode> iterator) {
- boolean exCaught = false;
- while (iterator.hasNext()) {
- iterator.next();
- }
- try {
- iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- public void testSize1() {
- this.verifySize(this.buildGraphIterator1());
- }
-
- public void testSize2() {
- this.verifySize(this.buildGraphIterator2());
- }
-
- private void verifySize(Iterator<GraphNode> iterator) {
- int iteratorSize = CollectionTools.size(iterator);
- int actualSize = this.nodes.size();
- assertTrue("Too few items in iterator.", iteratorSize >= actualSize);
- assertTrue("Too many items in iterator.", iteratorSize <= actualSize);
- }
-
- public void testInvalidGraphIterator() {
- boolean exCaught = false;
- try {
- // missing method override
- Iterator<GraphNode> iterator = new GraphIterator<GraphNode>(this.buildGraphRoot());
- GraphNode gn = iterator.next();
- fail("invalid graph node: " + gn);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- /**
- * build a graph iterator with an explicit misterRogers
- */
- private Iterator<GraphNode> buildGraphIterator1() {
- return new GraphIterator<GraphNode>(this.buildGraphRoot(), this.buildMisterRogers());
- }
-
- private GraphIterator.MisterRogers<GraphNode> buildMisterRogers() {
- return new GraphIterator.MisterRogers<GraphNode>() {
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- /**
- * build a graph iterator with an override
- */
- private Iterator<GraphNode> buildGraphIterator2() {
- return new GraphIterator<GraphNode>(this.buildGraphRoot()) {
- @Override
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- private GraphNode buildGraphRoot() {
- GraphNode ncNode = new GraphNode("North Carolina");
- GraphNode vaNode = new GraphNode("Virginia");
- GraphNode scNode = new GraphNode("South Carolina");
- GraphNode gaNode = new GraphNode("Georgia");
- GraphNode flNode = new GraphNode("Florida");
- GraphNode alNode = new GraphNode("Alabama");
- GraphNode msNode = new GraphNode("Mississippi");
- GraphNode tnNode = new GraphNode("Tennessee");
-
- ncNode.setNeighbors(new GraphNode[] { vaNode, scNode, gaNode, tnNode });
- vaNode.setNeighbors(new GraphNode[] { ncNode, tnNode });
- scNode.setNeighbors(new GraphNode[] { ncNode, gaNode });
- gaNode.setNeighbors(new GraphNode[] { ncNode, scNode, flNode, alNode, tnNode });
- flNode.setNeighbors(new GraphNode[] { gaNode });
- alNode.setNeighbors(new GraphNode[] { gaNode, msNode, tnNode });
- msNode.setNeighbors(new GraphNode[] { alNode, tnNode });
- tnNode.setNeighbors(new GraphNode[] { vaNode, ncNode, gaNode, alNode, msNode });
-
- return ncNode;
- }
-
- private class GraphNode {
- private String name;
-
- private Collection<GraphNode> neighbors = new ArrayList<GraphNode>();
-
- public GraphNode(String name) {
- super();
- GraphIteratorTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- void setNeighbors(GraphNode[] neighbors) {
- this.neighbors = CollectionTools.list(neighbors);
- }
-
- public Iterator<GraphNode> neighbors() {
- return this.neighbors.iterator();
- }
-
- public int neighborsSize() {
- return this.neighbors.size();
- }
-
- @Override
- public String toString() {
- return "GraphNode(" + this.name + ")";
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java
deleted file mode 100644
index 42d8eb459e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.IteratorEnumeration;
-
-public class IteratorEnumerationTests extends TestCase {
-
- public IteratorEnumerationTests(String name) {
- super(name);
- }
-
- public void testHasMoreElements() {
- int i = 0;
- for (Enumeration<String> stream = this.buildEnumeration(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasMoreElementsUpcast() {
- int i = 0;
- for (Enumeration<Object> stream = this.buildEnumerationUpcast(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNextElement() {
- Iterator<String> iterator = this.buildIterator();
- for (Enumeration<String> stream = this.buildEnumeration(); stream.hasMoreElements();) {
- assertEquals("bogus element", iterator.next(), stream.nextElement());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Enumeration<String> stream = this.buildEnumeration();
- String string = null;
- while (stream.hasMoreElements()) {
- string = stream.nextElement();
- }
- try {
- string = stream.nextElement();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- private Enumeration<String> buildEnumeration() {
- return this.buildEnumeration(this.buildIterator());
- }
-
- private Enumeration<Object> buildEnumerationUpcast() {
- return this.buildEnumerationUpcast(this.buildIterator());
- }
-
- private Enumeration<String> buildEnumeration(Iterator<String> iterator) {
- return new IteratorEnumeration<String>(iterator);
- }
-
- private Enumeration<Object> buildEnumerationUpcast(Iterator<String> iterator) {
- return new IteratorEnumeration<Object>(iterator);
- }
-
- private Iterator<String> buildIterator() {
- return this.buildVector().iterator();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
deleted file mode 100644
index 8d9d3f7270..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityIteratorsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityIteratorsTests.class.getPackage().getName());
-
- suite.addTestSuite(ArrayIteratorTests.class);
- suite.addTestSuite(ArrayListIteratorTests.class);
- suite.addTestSuite(ChainIteratorTests.class);
- suite.addTestSuite(CloneIteratorTests.class);
- suite.addTestSuite(CloneListIteratorTests.class);
- suite.addTestSuite(CompositeIteratorTests.class);
- suite.addTestSuite(CompositeListIteratorTests.class);
- suite.addTestSuite(EmptyEnumerationTests.class);
- suite.addTestSuite(EmptyIteratorTests.class);
- suite.addTestSuite(EmptyListIteratorTests.class);
- suite.addTestSuite(EnumerationIteratorTests.class);
- suite.addTestSuite(FilteringIteratorTests.class);
- suite.addTestSuite(GraphIteratorTests.class);
- suite.addTestSuite(IteratorEnumerationTests.class);
- suite.addTestSuite(PeekableIteratorTests.class);
- suite.addTestSuite(ReadOnlyCompositeListIteratorTests.class);
- suite.addTestSuite(ReadOnlyIteratorTests.class);
- suite.addTestSuite(ReadOnlyListIteratorTests.class);
- suite.addTestSuite(SingleElementIteratorTests.class);
- suite.addTestSuite(SingleElementListIteratorTests.class);
- suite.addTestSuite(TransformationIteratorTests.class);
- suite.addTestSuite(TransformationListIteratorTests.class);
- suite.addTestSuite(TreeIteratorTests.class);
-
- return suite;
- }
-
- private JptUtilityIteratorsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java
deleted file mode 100644
index 1a3b47b78f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.PeekableIterator;
-
-public class PeekableIteratorTests extends TestCase {
-
- public PeekableIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- String string = stream.next();
- if (string.equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildPeekableIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testNext() {
- Iterator<String> stream = this.buildPeekableIterator();
- assertEquals("zero", stream.next());
- assertEquals("one", stream.next());
- assertEquals("two", stream.next());
- assertEquals("three", stream.next());
- assertEquals("four", stream.next());
- assertEquals("five", stream.next());
- }
-
- public void testNextUpcast() {
- Iterator<Object> stream = this.buildPeekableIteratorUpcast();
- assertEquals("zero", stream.next());
- assertEquals("one", stream.next());
- assertEquals("two", stream.next());
- assertEquals("three", stream.next());
- assertEquals("four", stream.next());
- assertEquals("five", stream.next());
- }
-
- public void testPeek() {
- Object next = null;
- for (PeekableIterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- Object peek = stream.peek();
- assertTrue("peek and next are prematurely identical", peek != next);
- next = stream.next();
- assertTrue("peek and next are not identical", peek == next);
- }
- }
-
- public void testPeekUpcast() {
- Object next = null;
- for (PeekableIterator<Object> stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) {
- Object peek = stream.peek();
- assertTrue("peek and next are prematurely identical", peek != next);
- next = stream.next();
- assertTrue("peek and next are not identical", peek == next);
- }
- }
-
- private PeekableIterator<String> buildPeekableIterator() {
- return this.buildPeekableIterator(this.buildNestedIterator());
- }
-
- private PeekableIterator<Object> buildPeekableIteratorUpcast() {
- return this.buildPeekableIteratorUpcast(this.buildNestedIterator());
- }
-
- private PeekableIterator<String> buildPeekableIterator(Iterator<String> nestedIterator) {
- return new PeekableIterator<String>(nestedIterator);
- }
-
- private PeekableIterator<Object> buildPeekableIteratorUpcast(Iterator<String> nestedIterator) {
- return new PeekableIterator<Object>(nestedIterator);
- }
-
- private Iterator<String> buildNestedIterator() {
- Collection<String> c = new ArrayList<String>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- return c.iterator();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
deleted file mode 100644
index 8d92c03656..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-
-public class ReadOnlyCompositeListIteratorTests extends CompositeIteratorTests {
-
- public ReadOnlyCompositeListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- void verifyHasAnother(Iterator<String> stream) {
- super.verifyHasAnother(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- int i = 0;
- while (stream2.hasPrevious()) {
- stream2.previous();
- i++;
- }
- assertEquals(8, i);
- }
-
- @Override
- void verifyAnother(Iterator<String> stream) {
- super.verifyAnother(stream);
- int i = 8;
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- while (stream2.hasPrevious()) {
- assertEquals("bogus element", String.valueOf(i--), stream2.previous().substring(0, 1));
- }
- }
-
- public void testNextIndexPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator();
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasNext()) {
- stream.next();
- i++;
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 8, i);
-
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 0, i);
- }
-
- public void testPreviousIndex() {
- // TODO
- }
-
- @Override
- public void testRemove() {
- // #remove() is not supported
- }
-
- @Override
- public void testIllegalStateException() {
- // #remove() is not supported
- }
-
- @Override
- public void testEmptyIllegalStateException1() {
- // #remove() is not supported
- }
-
- @Override
- public void testEmptyIllegalStateException2() {
- // #remove() is not supported
- }
-
- @Override
- void verifyNoSuchElementException(Iterator<String> stream) {
- super.verifyNoSuchElementException(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- boolean exCaught = false;
- String string = null;
- while (stream2.hasPrevious()) {
- string = stream2.previous();
- }
- try {
- string = stream2.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- @Override
- void verifyUnsupportedOperationException(Iterator<String> stream) {
- super.verifyUnsupportedOperationException(stream);
- boolean exCaught = false;
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- while (stream2.hasPrevious()) {
- Object string = stream2.previous();
- if (string.equals("333")) {
- try {
- stream2.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- void verifyIllegalStateException(Iterator<String> stream) {
- super.verifyIllegalStateException(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- boolean exCaught = false;
- try {
- stream2.set("junk");
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- @Override
- void verifyEmptyHasAnother(Iterator<String> stream) {
- super.verifyEmptyHasAnother(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- int i = 0;
- while (stream2.hasPrevious()) {
- stream2.previous();
- i++;
- }
- assertEquals(0, i);
- }
-
- // unchecked so we can override the unchecked method in superclass
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new ReadOnlyCompositeListIterator<String>((ListIterator<ListIterator<String>>) iterators);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new ReadOnlyCompositeListIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new ReadOnlyCompositeListIterator<String>(new ListIterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- Iterator<String> buildCompositeIterator(String string, ListIterator<String> iterator) {
- return this.buildCompositeListIterator(string, iterator);
- }
-
- ListIterator<String> buildCompositeListIterator(String string, ListIterator<String> iterator) {
- return new ReadOnlyCompositeListIterator<String>(string, iterator);
- }
-
- public void testVariedNestedIterators() {
- List<Integer> integerList = new ArrayList<Integer>();
- integerList.add(new Integer(42));
- integerList.add(new Integer(42));
- integerList.add(new Integer(111));
- integerList.add(new Integer(77));
-
- List<Float> floatList = new ArrayList<Float>();
- floatList.add(new Float(42.42f));
- floatList.add(new Float(22.22f));
- floatList.add(new Float(111.111f));
- floatList.add(new Float(77.77f));
-
- List<ListIterator<? extends Number>> list = new ArrayList<ListIterator<? extends Number>>();
- list.add(integerList.listIterator());
- list.add(floatList.listIterator());
- ListIterator<Number> li = new ReadOnlyCompositeListIterator<Number>(list);
- while (li.hasNext()) {
- assertTrue(li.next().intValue() > 0);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
deleted file mode 100644
index 4defa2e414..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-
-public class ReadOnlyIteratorTests extends TestCase {
-
- public ReadOnlyIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNext() {
- Iterator<String> nestedIterator = this.buildNestedIterator();
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNextUpcast() {
- Iterator<String> nestedIterator = this.buildNestedIterator();
- for (Iterator<Object> stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildReadOnlyIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<String> buildReadOnlyIterator() {
- return this.buildReadOnlyIterator(this.buildNestedIterator());
- }
-
- private Iterator<Object> buildReadOnlyIteratorUpcast() {
- return this.buildReadOnlyIteratorUpcast(this.buildNestedIterator());
- }
-
- private Iterator<String> buildReadOnlyIterator(Iterator<String> nestedIterator) {
- return new ReadOnlyIterator<String>(nestedIterator);
- }
-
- private Iterator<Object> buildReadOnlyIteratorUpcast(Iterator<String> nestedIterator) {
- return new ReadOnlyIterator<Object>(nestedIterator);
- }
-
- private Iterator<String> buildNestedIterator() {
- return this.buildVector().iterator();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
deleted file mode 100644
index 4db72f6754..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-
-public class ReadOnlyListIteratorTests extends TestCase {
-
- public ReadOnlyListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(this.buildList().size(), i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testHasNextAndHasPreviousUpcast() {
- int i = 0;
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(this.buildList().size(), i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testNextAndPrevious() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNextAndPreviousUpcast() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNextIndexAndPreviousIndex() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex());
- nestedListIterator.next();
- stream.next();
- }
- assertEquals("bogus index", this.buildList().size(), stream.nextIndex());
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex());
- nestedListIterator.previous();
- stream.previous();
- }
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testNextIndexAndPreviousIndexUpcast() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex());
- nestedListIterator.next();
- stream.next();
- }
- assertEquals("bogus index", this.buildList().size(), stream.nextIndex());
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex());
- nestedListIterator.previous();
- stream.previous();
- }
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.set("bogus");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testAdd() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.add("bogus");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private ListIterator<String> buildReadOnlyListIterator() {
- return this.buildReadOnlyListIterator(this.buildNestedListIterator());
- }
-
- private ListIterator<Object> buildReadOnlyListIteratorUpcast() {
- return this.buildReadOnlyListIteratorUpcast(this.buildNestedListIterator());
- }
-
- private ListIterator<String> buildReadOnlyListIterator(ListIterator<String> nestedListIterator) {
- return new ReadOnlyListIterator<String>(nestedListIterator);
- }
-
- private ListIterator<Object> buildReadOnlyListIteratorUpcast(ListIterator<String> nestedListIterator) {
- return new ReadOnlyListIterator<Object>(nestedListIterator);
- }
-
- private ListIterator<String> buildNestedListIterator() {
- return this.buildList().listIterator();
- }
-
- private List<String> buildList() {
- List<String> l = new ArrayList<String>();
- l.add("one");
- l.add("two");
- l.add("three");
- l.add("four");
- l.add("five");
- l.add("six");
- l.add("seven");
- l.add("eight");
- return l;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java
deleted file mode 100644
index e84657c93d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-public class SingleElementIteratorTests extends TestCase {
-
- public SingleElementIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(1, i);
- }
-
- public void testNext() {
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- assertEquals("bogus element", this.singleElement(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildSingleElementIterator();
- String string = stream.next();
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- protected Iterator<String> buildSingleElementIterator() {
- return new SingleElementIterator<String>(this.singleElement());
- }
-
- protected String singleElement() {
- return "single element";
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java
deleted file mode 100644
index e3e4197c7d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-public class SingleElementListIteratorTests extends SingleElementIteratorTests {
-
- public SingleElementListIteratorTests(String name) {
- super(name);
- }
-
- public void testNextIndex() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus index", 0, stream.nextIndex());
- stream.next();
- }
- assertEquals("bogus index", 1, stream.nextIndex());
- }
-
- public void testHasPrevious() {
- int i = 0;
- ListIterator<String> stream = this.buildSingleElementListIterator();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(1, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(2, i);
- }
-
- public void testPrevious() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- while (stream.hasNext()) {
- assertEquals("bogus element", this.singleElement(), stream.next());
- }
-
- while (stream.hasPrevious()) {
- assertEquals("bogus element", this.singleElement(), stream.previous());
- }
- }
-
- public void testPreviousIndex() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- while (stream.hasNext()) {
- assertEquals("bogus index", 0, stream.nextIndex());
- stream.next();
- }
-
- while (stream.hasPrevious()) {
- assertEquals("bogus index", 0, stream.previousIndex());
- stream.previous();
- }
-
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testAdd() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- try {
- stream.add("foo");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
-
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildSingleElementListIterator(); stream.hasNext();) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.set("foo");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- protected Iterator<String> buildSingleElementIterator() {
- return new SingleElementListIterator<String>(this.singleElement());
- }
-
- protected ListIterator<String> buildSingleElementListIterator() {
- return (ListIterator<String>) this.buildSingleElementIterator();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java
deleted file mode 100644
index bef2552570..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class TransformationIteratorTests extends TestCase {
-
- public TransformationIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, stream.next().intValue());
- }
- }
-
- public void testNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, ((Integer) stream.next()).intValue());
- }
- }
-
- public void testInnerNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildInnerIterator(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, stream.next().intValue());
- }
- }
-
- public void testRemove() {
- Collection<String> c = this.buildCollection();
- for (Iterator<Integer> stream = this.buildInnerTransformationIterator(c.iterator()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildCollection().size() - 1, c.size());
- assertFalse("element still in collection", c.contains("333"));
- assertTrue("wrong element removed", c.contains("22"));
- }
-
- public void testInnerRemove() {
- Collection<String> c = this.buildCollection();
- for (Iterator<Integer> stream = this.buildTransformationIterator(c.iterator(), this.buildTransformer()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildCollection().size() - 1, c.size());
- assertFalse("element still in collection", c.contains("333"));
- assertTrue("wrong element removed", c.contains("22"));
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Integer> stream = this.buildIterator();
- Integer integer = null;
- while (stream.hasNext()) {
- integer = stream.next();
- }
- try {
- integer = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + integer, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Integer> stream = this.buildUnmodifiableIterator(); stream.hasNext();) {
- int i = stream.next().intValue();
- if (i == 3) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- boolean exCaught = false;
- try {
- this.buildIterator().remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- private Iterator<Integer> buildIterator() {
- return this.buildTransformationIterator(this.buildNestedIterator(), this.buildTransformer());
- }
-
- private Iterator<Object> buildIteratorUpcast() {
- return this.buildTransformationIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast());
- }
-
- private Iterator<Integer> buildInnerIterator() {
- return this.buildInnerTransformationIterator(this.buildNestedIterator());
- }
-
- private Iterator<Integer> buildUnmodifiableIterator() {
- return this.buildTransformationIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer());
- }
-
- private Iterator<Integer> buildTransformationIterator(Iterator<String> nestedIterator, Transformer<String, Integer> transformer) {
- return new TransformationIterator<String, Integer>(nestedIterator, transformer);
- }
-
- private Iterator<Object> buildTransformationIteratorUpcast(Iterator<String> nestedIterator, Transformer<Object, Integer> transformer) {
- return new TransformationIterator<Object, Object>(nestedIterator, transformer);
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Transformer<Object, Integer> buildTransformerUpcast() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<Object, Integer>() {
- public Integer transform(Object next) {
- return new Integer(((String) next).length());
- }
- };
- }
-
- private Iterator<Integer> buildInnerTransformationIterator(Iterator<String> nestedIterator) {
- // transform each string into an integer with a value of the string's length
- return new TransformationIterator<String, Integer>(nestedIterator) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Iterator<String> buildNestedIterator() {
- return this.buildCollection().iterator();
- }
-
- private Iterator<String> buildUnmodifiableNestedIterator() {
- return this.buildUnmodifiableCollection().iterator();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add("1");
- c.add("22");
- c.add("333");
- c.add("4444");
- c.add("55555");
- c.add("666666");
- c.add("7777777");
- c.add("88888888");
- return c;
- }
-
- private Collection<String> buildUnmodifiableCollection() {
- return Collections.unmodifiableCollection(this.buildCollection());
- }
-
- public void testInvalidTransformationIterator() {
- // missing method override
- Iterator<Integer> iterator = new TransformationIterator<String, Integer>(this.buildCollection().iterator());
- boolean exCaught = false;
- try {
- Integer integer = iterator.next();
- fail("invalid integer: " + integer);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
deleted file mode 100644
index dc8a2e02c7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-
-public class TransformationListIteratorTests extends TestCase {
-
- public TransformationListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testHasNextAndHasPreviousUpcast() {
- int i = 0;
- ListIterator<Object> stream = this.buildIteratorUpcast();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testInnerHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testNextAndPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.next().intValue());
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previous().intValue());
- }
- }
-
- public void testInnerNextAndPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.next().intValue());
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previous().intValue());
- }
- }
-
- public void testNextIndexAndPreviousIndex() {
- int i = -1;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.nextIndex());
- stream.next();
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previousIndex());
- stream.previous();
- }
- }
-
- public void testInnerNextIndexAndPreviousIndex() {
- int i = -1;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.nextIndex());
- stream.next();
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previousIndex());
- stream.previous();
- }
- }
-
- public void testRemove() {
- List<String> l = this.buildList();
- for (ListIterator<Integer> stream = this.buildInnerTransformationListIterator(l.listIterator()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildList().size() - 1, l.size());
- assertFalse("element still in list", l.contains("333"));
- assertTrue("wrong element removed", l.contains("22"));
- }
-
- public void testInnerRemove() {
- List<String> l = this.buildList();
- for (ListIterator<Integer> stream = this.buildTransformationListIterator(l.listIterator(), this.buildTransformer()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildList().size() - 1, l.size());
- assertFalse("element still in list", l.contains("333"));
- assertTrue("wrong element removed", l.contains("22"));
- }
-
- public void testUnsupportedOperationExceptionOnAdd() {
- ListIterator<Integer> stream = this.buildIterator();
- boolean exCaught = false;
- try {
- stream.add(new Integer(0));
- fail("exception not thrown");
- } catch (UnsupportedOperationException e) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUnsupportedOperationExceptionOnSet() {
- ListIterator<Integer> stream = this.buildIterator();
- boolean exCaught = false;
- try {
- stream.set(new Integer(0));
- fail("exception not thrown");
- } catch (UnsupportedOperationException e) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<Integer> stream = this.buildIterator();
- Integer integer = null;
- while (stream.hasNext()) {
- integer = stream.next();
- }
- try {
- integer = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + integer, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Integer> stream = this.buildUnmodifiableIterator(); stream.hasNext();) {
- int i = stream.next().intValue();
- if (i == 3) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- boolean exCaught = false;
- try {
- this.buildIterator().remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- private ListIterator<Integer> buildIterator() {
- return this.buildTransformationListIterator(this.buildNestedIterator(), this.buildTransformer());
- }
-
- private ListIterator<Object> buildIteratorUpcast() {
- return this.buildTransformationListIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast());
- }
-
- private ListIterator<Integer> buildInnerIterator() {
- return this.buildInnerTransformationListIterator(this.buildNestedIterator());
- }
-
- private ListIterator<Integer> buildUnmodifiableIterator() {
- return this.buildTransformationListIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer());
- }
-
- private ListIterator<Integer> buildTransformationListIterator(ListIterator<String> nestedIterator, Transformer<String, Integer> transformer) {
- return new TransformationListIterator<String, Integer>(nestedIterator, transformer);
- }
-
- private ListIterator<Object> buildTransformationListIteratorUpcast(ListIterator<String> nestedIterator, Transformer<Object, Integer> transformer) {
- return new TransformationListIterator<Object, Object>(nestedIterator, transformer);
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Transformer<Object, Integer> buildTransformerUpcast() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<Object, Integer>() {
- public Integer transform(Object next) {
- return new Integer(((String) next).length());
- }
- };
- }
-
- private ListIterator<Integer> buildInnerTransformationListIterator(ListIterator<String> nestedIterator) {
- // transform each string into an integer with a value of the string's length
- return new TransformationListIterator<String, Integer>(nestedIterator) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private ListIterator<String> buildNestedIterator() {
- return this.buildList().listIterator();
- }
-
- private ListIterator<String> buildUnmodifiableNestedIterator() {
- return this.buildUnmodifiableList().listIterator();
- }
-
- private List<String> buildList() {
- List<String> l = new ArrayList<String>();
- l.add("1");
- l.add("22");
- l.add("333");
- l.add("4444");
- l.add("55555");
- l.add("666666");
- l.add("7777777");
- l.add("88888888");
- return l;
- }
-
- private List<String> buildUnmodifiableList() {
- return Collections.unmodifiableList(this.buildList());
- }
-
- public void testInvalidTransformationListIterator() {
- // missing method override
- Iterator<Integer> iterator = new TransformationListIterator<String, Integer>(this.buildList().listIterator());
- boolean exCaught = false;
- try {
- Integer integer = iterator.next();
- fail("invalid integer: " + integer);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
deleted file mode 100644
index e15f1a8d50..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class TreeIteratorTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<TreeNode> nodes = new ArrayList<TreeNode>();
-
- public TreeIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext1() {
- this.verifyHasNext(this.buildTreeIterator1());
- }
-
- public void testHasNext2() {
- this.verifyHasNext(this.buildTreeIterator2());
- }
-
- private void verifyHasNext(Iterator<TreeNode> iterator) {
- int i = 0;
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(this.nodes.size(), i);
- }
-
- public void testNext1() {
- this.verifyNext(this.buildTreeIterator1());
- }
-
- public void testNext2() {
- this.verifyNext(this.buildTreeIterator2());
- }
-
- private void verifyNext(Iterator<TreeNode> iterator) {
- while (iterator.hasNext()) {
- assertTrue("bogus element", this.nodes.contains(iterator.next()));
- }
- }
-
- public void testNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildTreeIterator1());
- }
-
- public void testNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildTreeIterator2());
- }
-
- private void verifyNoSuchElementException(Iterator<TreeNode> iterator) {
- boolean exCaught = false;
- while (iterator.hasNext()) {
- iterator.next();
- }
- try {
- iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- public void testRemove1() {
- this.verifyRemove(this.buildTreeIterator1());
- }
-
- public void testRemove2() {
- this.verifyRemove(this.buildTreeIterator2());
- }
-
- private void verifyRemove(Iterator<TreeNode> iterator) {
- String parentName = "child 2";
- String childName = "grandchild 2A";
- int startSize = this.childrenSize(parentName);
- while (iterator.hasNext()) {
- TreeNode node = iterator.next();
- if (node.getName().equals(childName)) {
- iterator.remove();
- }
- }
- int endSize = this.childrenSize(parentName);
- assertEquals(startSize - 1, endSize);
- }
-
- private int childrenSize(String nodeName) {
- for (Iterator<TreeNode> stream = this.nodes.iterator(); stream.hasNext();) {
- TreeNode node = stream.next();
- if (node.getName().equals(nodeName)) {
- return node.childrenSize();
- }
- }
- throw new IllegalArgumentException(nodeName);
- }
-
- /**
- * build a tree iterator with an explicit midwife
- */
- private Iterator<TreeNode> buildTreeIterator1() {
- return new TreeIterator<TreeNode>(this.buildTree(), this.buildMidwife());
- }
-
- private TreeIterator.Midwife<TreeNode> buildMidwife() {
- return new TreeIterator.Midwife<TreeNode>() {
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- /**
- * build a tree iterator with an override
- */
- private Iterator<TreeNode> buildTreeIterator2() {
- return new TreeIterator<TreeNode>(this.buildTree()) {
- @Override
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- public void testInvalidTreeIterator() {
- // missing method override
- Iterator<TreeNode> iterator = new TreeIterator<TreeNode>(this.buildTree());
- boolean exCaught = false;
- try {
- TreeNode tn = iterator.next();
- fail("invalid tree node: " + tn);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- private TreeNode buildTree() {
- TreeNode root = new TreeNode("root");
- TreeNode child1 = new TreeNode(root, "child 1");
- new TreeNode(child1, "grandchild 1A");
- TreeNode child2 = new TreeNode(root, "child 2");
- new TreeNode(child2, "grandchild 2A");
- TreeNode grandchild2B = new TreeNode(child2, "grandchild 2B");
- new TreeNode(grandchild2B, "great-grandchild 2B1");
- new TreeNode(grandchild2B, "great-grandchild 2B2");
- TreeNode grandchild2C = new TreeNode(child2, "grandchild 2C");
- new TreeNode(grandchild2C, "great-grandchild 2C1");
- new TreeNode(root, "child 3");
- return root;
- }
-
- private class TreeNode {
- private String name;
- private Collection<TreeNode> children = new ArrayList<TreeNode>();
-
- public TreeNode(String name) {
- super();
- TreeIteratorTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public TreeNode(TreeNode parent, String name) {
- this(name);
- parent.addChild(this);
- }
-
- public String getName() {
- return this.name;
- }
-
- private void addChild(TreeNode child) {
- this.children.add(child);
- }
-
- public Iterator<TreeNode> children() {
- return this.children.iterator();
- }
-
- public int childrenSize() {
- return this.children.size();
- }
-
- @Override
- public String toString() {
- return "TreeNode(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
deleted file mode 100644
index 42a14dbec1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
+++ /dev/null
@@ -1,1721 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class AbstractModelTests
- extends TestCase
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
-{
- private TestModel testModel;
- private static final String TEST_TO_STRING = "this is a test";
-
- private StateChangeEvent stateChangeEvent;
- private boolean stateChangedCalled = false;
-
- private PropertyChangeEvent propertyChangeEvent;
- private boolean propertyChangeCalled = false;
- private static final String PROPERTY_NAME = "propertyName";
- static final Object OLD_OBJECT_VALUE = new Object();
- static final Object NEW_OBJECT_VALUE = new Object();
- static final Integer OLD_INT_VALUE = new Integer(27);
- static final Integer NEW_INT_VALUE = new Integer(42);
- static final Boolean OLD_BOOLEAN_VALUE = Boolean.TRUE;
- static final Boolean NEW_BOOLEAN_VALUE = Boolean.FALSE;
-
- private CollectionChangeEvent collectionChangeEvent;
- private boolean itemsAddedCollectionCalled = false;
- private boolean itemsRemovedCollectionCalled = false;
- private boolean collectionChangedCalled = false;
- private boolean collectionClearedCalled = false;
- private static final String COLLECTION_NAME = "collectionName";
- static final Object ADDED_OBJECT_VALUE = new Object();
- static final Object REMOVED_OBJECT_VALUE = new Object();
- static final int TARGET_INDEX = 7;
- static final int SOURCE_INDEX = 22;
-
- private ListChangeEvent listChangeEvent;
- private boolean itemsAddedListCalled = false;
- private boolean itemsRemovedListCalled = false;
- private boolean itemsReplacedListCalled = false;
- private boolean itemsMovedListCalled = false;
- private boolean listChangedCalled = false;
- private boolean listClearedCalled = false;
- private static final String LIST_NAME = "listName";
- private static final int ADD_INDEX = 3;
- private static final int REMOVE_INDEX = 5;
- private static final int REPLACE_INDEX = 2;
-
- private TreeChangeEvent treeChangeEvent;
- private boolean nodeAddedCalled = false;
- private boolean nodeRemovedCalled = false;
- private boolean treeChangedCalled = false;
- private boolean treeClearedCalled = false;
- private static final String TREE_NAME = "treeName";
- static final Object[] OBJECT_ARRAY_PATH = {new Object(), new Object(), new String()};
- static final Object[] EMPTY_PATH = {};
-
- public AbstractModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testModel = new TestModel();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testFireStateChange() {
- this.stateChangeEvent = null;
- this.stateChangedCalled = false;
- this.testModel.addStateChangeListener(this);
- this.testModel.testFireStateChange();
- assertNotNull(this.stateChangeEvent);
- assertEquals(this.testModel, this.stateChangeEvent.getSource());
- assertTrue(this.stateChangedCalled);
- }
-
- public void testFirePropertyChangeObjectObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeIntInt() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeBooleanBoolean() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFireItemAddedCollection() {
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionChangeEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionChangeEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemRemovedCollection() {
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionChangeEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionChangeEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireCollectionCleared() {
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testFireCollectionChanged() {
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionChangedCalled);
- }
-
- public void testFireItemAddedList() {
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemAddedList();
- this.verifyListChangeEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemAddedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemAddedList();
- this.verifyListChangeEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemAddedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemRemovedList() {
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemRemovedList();
- this.verifyListChangeEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemRemovedList();
- this.verifyListChangeEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemReplacedList() {
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemReplacedList();
- this.verifyListChangeEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemReplacedList();
- this.verifyListChangeEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemMovedList() {
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemMovedList();
- this.verifyListChangeEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemMovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemMovedList();
- this.verifyListChangeEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemMovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireListCleared() {
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireListCleared();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireListCleared();
- assertNull(this.listChangeEvent);
- assertFalse(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireListCleared();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireListCleared();
- assertNull(this.listChangeEvent);
- assertFalse(this.listClearedCalled);
- }
-
- public void testFireListChanged() {
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireListChanged();
- assertNull(this.listChangeEvent);
- assertFalse(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireListChanged();
- assertNull(this.listChangeEvent);
- assertFalse(this.listChangedCalled);
- }
-
- public void testFireNodeAddedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeAddedCalled);
- }
-
- public void testFireNodeRemovedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeRemovedCalled);
- }
-
- public void testFireTreeCleared() {
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireTreeCleared();
- this.verifyTreeChangeEvent(EMPTY_PATH);
- assertTrue(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeCleared();
- this.verifyTreeChangeEvent(EMPTY_PATH);
- assertTrue(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeClearedCalled);
- }
-
- public void testFireTreeChangedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeChangedCalled);
- }
-
- public void testHasAnyChangeListeners() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(this);
-
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
-
- assertFalse(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(this);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(this);
-
- assertFalse(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
-
- assertFalse(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(this);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(this);
-
- assertFalse(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(LIST_NAME, this);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(LIST_NAME, this);
-
- assertFalse(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(this);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(this);
-
- assertFalse(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- }
-
- public void testAttributeValueHasChanged() {
- this.testModel.testAttributeValueHasChanged();
- }
-
- public void testClone() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
-
- // verify that the clone does not have any listeners
- TestModel clone = this.testModel.clone();
- assertFalse(clone.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- clone.addPropertyChangeListener(this);
- assertTrue(clone.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- // check original
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
-
- // now test events fired by original
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- // now test events fired by clone
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- clone.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(clone, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
- }
-
- public void testAddNullStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.addStateChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.addPropertyChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullListListener() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullPropertyListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addPropertyChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullCollectionListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullListListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullTreeListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeStateChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addStateChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- assertTrue(this.testModel.toString().indexOf(TEST_TO_STRING) != -1);
- }
-
-// ********** internal methods **********
-
- private void verifyPropertyChangeEvent(Object oldValue, Object newValue) {
- this.verifyPropertyChangeEvent(this.testModel, oldValue, newValue);
- }
-
- private void verifyPropertyChangeEvent(Object source, Object oldValue, Object newValue) {
- assertNotNull(this.propertyChangeEvent);
- assertEquals(source, this.propertyChangeEvent.getSource());
- assertEquals(PROPERTY_NAME, this.propertyChangeEvent.getPropertyName());
- assertEquals(oldValue, this.propertyChangeEvent.getOldValue());
- assertEquals(newValue, this.propertyChangeEvent.getNewValue());
- }
-
- private void verifyCollectionChangeEvent(Object item) {
- assertNotNull(this.collectionChangeEvent);
- assertEquals(this.testModel, this.collectionChangeEvent.getSource());
- assertEquals(COLLECTION_NAME, this.collectionChangeEvent.getCollectionName());
- if (item == null) {
- assertFalse(this.collectionChangeEvent.items().hasNext());
- } else {
- assertEquals(item, this.collectionChangeEvent.items().next());
- }
- }
-
- private void verifyListChangeEvent(int index, Object item) {
- this.verifyListChangeEvent(index, item, null);
- }
-
- private void verifyListChangeEvent(int targetIndex, int sourceIndex) {
- assertNotNull(this.listChangeEvent);
- assertEquals(this.testModel, this.listChangeEvent.getSource());
- assertEquals(LIST_NAME, this.listChangeEvent.getListName());
- assertEquals(targetIndex, this.listChangeEvent.getTargetIndex());
- assertEquals(sourceIndex, this.listChangeEvent.getSourceIndex());
- }
-
- private void verifyListChangeEvent(int index, Object item, Object replacedItem) {
- assertNotNull(this.listChangeEvent);
- assertEquals(this.testModel, this.listChangeEvent.getSource());
- assertEquals(LIST_NAME, this.listChangeEvent.getListName());
- assertEquals(index, this.listChangeEvent.getIndex());
- if (item == null) {
- assertFalse(this.listChangeEvent.items().hasNext());
- } else {
- assertEquals(item, this.listChangeEvent.items().next());
- }
- if (replacedItem == null) {
- assertFalse(this.listChangeEvent.replacedItems().hasNext());
- } else {
- assertEquals(replacedItem, this.listChangeEvent.replacedItems().next());
- }
- }
-
- private void verifyTreeChangeEvent(Object[] path) {
- assertNotNull(this.treeChangeEvent);
- assertEquals(this.testModel, this.treeChangeEvent.getSource());
- assertEquals(TREE_NAME, this.treeChangeEvent.getTreeName());
- assertTrue(Arrays.equals(path, this.treeChangeEvent.getPath()));
- }
-
- public void testValuesAreEqual1() {
- assertTrue(this.testModel.testValuesAreEqual(null, null));
- assertFalse(this.testModel.testValuesAreDifferent(null, null));
- }
-
- public void testValuesAreEqual2() {
- assertTrue(this.testModel.testValuesAreEqual("foo", "foo"));
- assertFalse(this.testModel.testValuesAreDifferent("foo", "foo"));
- }
-
- public void testValuesAreEqual3() {
- assertFalse(this.testModel.testValuesAreEqual("foo", null));
- assertTrue(this.testModel.testValuesAreDifferent("foo", null));
- }
-
- public void testValuesAreEqual4() {
- assertFalse(this.testModel.testValuesAreEqual(null, "foo"));
- assertTrue(this.testModel.testValuesAreDifferent(null, "foo"));
- }
-
- public void testValuesAreEqual5() {
- assertFalse(this.testModel.testValuesAreEqual("bar", "foo"));
- assertTrue(this.testModel.testValuesAreDifferent("bar", "foo"));
- }
-
-
- // ********** listener implementations **********
-
- public void stateChanged(StateChangeEvent e) {
- this.stateChangedCalled = true;
- this.stateChangeEvent = e;
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- this.propertyChangeCalled = true;
- this.propertyChangeEvent = e;
- }
-
- public void itemsAdded(CollectionChangeEvent e) {
- this.itemsAddedCollectionCalled = true;
- this.collectionChangeEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- this.itemsRemovedCollectionCalled = true;
- this.collectionChangeEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- this.collectionClearedCalled = true;
- this.collectionChangeEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- this.collectionChangedCalled = true;
- this.collectionChangeEvent = e;
- }
-
- public void itemsAdded(ListChangeEvent e) {
- this.itemsAddedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- this.itemsRemovedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- this.itemsReplacedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- this.itemsMovedListCalled = true;
- this.listChangeEvent = e;
- }
- public void listCleared(ListChangeEvent e) {
- this.listClearedCalled = true;
- this.listChangeEvent = e;
- }
- public void listChanged(ListChangeEvent e) {
- this.listChangedCalled = true;
- this.listChangeEvent = e;
- }
-
- public void nodeAdded(TreeChangeEvent e) {
- this.nodeAddedCalled = true;
- this.treeChangeEvent = e;
- }
- public void nodeRemoved(TreeChangeEvent e) {
- this.nodeRemovedCalled = true;
- this.treeChangeEvent = e;
- }
- public void treeCleared(TreeChangeEvent e) {
- this.treeClearedCalled = true;
- this.treeChangeEvent = e;
- }
- public void treeChanged(TreeChangeEvent e) {
- this.treeChangedCalled = true;
- this.treeChangeEvent = e;
- }
-
- // ********** inner class **********
-
- private static class TestModel extends AbstractModel implements Cloneable {
- TestModel() {
- super();
- }
-
- public void testFireStateChange() {
- this.fireStateChanged();
- }
-
- public void testFirePropertyChangeObjectObject() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangeObject() {
- this.firePropertyChanged(PROPERTY_NAME, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangeIntInt() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_INT_VALUE.intValue(), NEW_INT_VALUE.intValue());
- }
-
- public void testFirePropertyChangeBooleanBoolean() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_BOOLEAN_VALUE.booleanValue(), NEW_BOOLEAN_VALUE.booleanValue());
- }
-
- public void testFireItemAddedCollection() {
- this.fireItemAdded(COLLECTION_NAME, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemRemovedCollection() {
- this.fireItemRemoved(COLLECTION_NAME, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireCollectionCleared() {
- this.fireCollectionCleared(COLLECTION_NAME);
- }
-
- public void testFireCollectionChanged() {
- this.fireCollectionChanged(COLLECTION_NAME);
- }
-
- public void testFireItemAddedList() {
- this.fireItemAdded(LIST_NAME, ADD_INDEX, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemRemovedList() {
- this.fireItemRemoved(LIST_NAME, REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemReplacedList() {
- this.fireItemReplaced(LIST_NAME, REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemMovedList() {
- this.fireItemMoved(LIST_NAME, TARGET_INDEX, SOURCE_INDEX);
- }
-
- public void testFireListCleared() {
- this.fireListCleared(LIST_NAME);
- }
-
- public void testFireListChanged() {
- this.fireListChanged(LIST_NAME);
- }
-
- public void testFireNodeAddedObjectArrayPath() {
- this.fireNodeAdded(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testFireNodeRemovedObjectArrayPath() {
- this.fireNodeRemoved(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testFireTreeCleared() {
- this.fireTreeCleared(TREE_NAME);
- }
-
- public void testFireTreeChangedObjectArrayPath() {
- this.fireTreeChanged(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testAttributeValueHasChanged() {
- assertTrue(this.attributeValueHasChanged(null, new Object()));
- assertTrue(this.attributeValueHasChanged(new Object(), null));
- assertTrue(this.attributeValueHasChanged(new Object(), new Object()));
-
- Object same = new Object();
- assertFalse(this.attributeValueHasChanged(same, same));
- assertFalse(this.attributeValueHasChanged(null, null));
- }
-
- @Override
- public TestModel clone() {
- try {
- return (TestModel) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean testValuesAreDifferent(Object value1, Object value2) {
- return this.valuesAreDifferent(value1, value2);
- }
-
- public boolean testValuesAreEqual(Object value1, Object value2) {
- return this.valuesAreEqual(value1, value2);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(TEST_TO_STRING);
- }
-
- }
-
-
- // ********** serialization test **********
-
-//TODO - This test doesn't pass in the Eclipse build environment (Linux) for some reason
-// public void testSerialization() throws IOException, ClassNotFoundException {
-// LocalModel model1 = new LocalModel();
-// Foo foo1 = new Foo();
-// Bar bar1 = new Bar();
-// Joo joo1 = new Joo();
-// Jar jar1 = new Jar();
-// model1.addStateChangeListener(foo1);
-// model1.addStateChangeListener(bar1);
-// model1.addListChangeListener(joo1);
-// model1.addListChangeListener(jar1);
-//
-// ChangeListener[] listeners1 = this.listeners(model1, StateChangeListener.class);
-// assertEquals(2, listeners1.length);
-// // the order of these could change...
-// assertEquals(Foo.class, listeners1[0].getClass());
-// assertEquals(Bar.class, listeners1[1].getClass());
-//
-// listeners1 = this.listeners(model1, ListChangeListener.class);
-// assertEquals(2, listeners1.length);
-// // the order of these could change...
-// assertEquals(Joo.class, listeners1[0].getClass());
-// assertEquals(Jar.class, listeners1[1].getClass());
-//
-// LocalModel model2 = TestTools.serialize(model1);
-//
-// ChangeListener[] listeners2 = this.listeners(model2, StateChangeListener.class);
-// assertEquals(1, listeners2.length);
-// assertEquals(Foo.class, listeners2[0].getClass());
-//
-// listeners2 = this.listeners(model2, ListChangeListener.class);
-// assertEquals(1, listeners2.length);
-// assertEquals(Joo.class, listeners2[0].getClass());
-// }
-
-// >>>>>>>>>>>>>>>>> these methods are called by #testSerialization(), commented out above...
- private ChangeListener[] listeners(LocalModel model, Class<? extends ChangeListener> listenerClass) {
- ChangeSupport changeSupport = (ChangeSupport) ClassTools.fieldValue(model, "changeSupport");
- return (ChangeListener[]) ClassTools.executeMethod(changeSupport, "listeners", Class.class, listenerClass);
- }
-
- private static class LocalModel extends AbstractModel implements Serializable {
- LocalModel() {
- super();
- }
- }
-
- private static class Foo implements Serializable, StateChangeListener {
- Foo() {
- super();
- }
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
- }
-
- private static class Bar implements StateChangeListener {
- Bar() {
- super();
- }
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
- }
-
- private static class Joo extends ListChangeAdapter implements Serializable {
-// private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("changeSupport", ChangeSupport.class)};
- Joo() {
- super();
- }
- }
-
- private static class Jar extends ListChangeAdapter {
- Jar() {
- super();
- }
- }
-
-
- // ********** bug(?) test **********
-
- private static final String ISE_MESSAGE = "this object is no longer listening to localA";
-
- /**
- * Test the following situation:
- * - both B and C are listening to A
- * - C is also listening to B
- * - when B receives an event from A, it will fire an event to C
- * - when C receives an event from B, it will STOP listening to A
- * - the event from B to C may be preceded or followed (depending on
- * the hash positions of listeners) by an event from A to C:
- * - if the A to C event comes first, no problem
- * - but if the A to B event comes first, the A to C event should NOT happen
- */
- public void testIndirectRemoveStateListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyStateListeners();
- }
- }
- );
- }
-
- public void testIndirectRemovePropertyListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyPropertyListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveCollectionListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyCollectionListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveListListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyListListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveTreeListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyTreeListeners();
- }
- }
- );
- }
-
- public void verifyIndirectRemoveListener(NotifyCommand command) {
- LocalA localA = new LocalA();
- LocalB localB = new LocalB(localA);
-
- // build a bunch of LocalCs so at least one of them is notified AFTER the LocalB;
- // using 1000 seemed to fail very consistently before ChangeSupport was fixed
- LocalC[] localCs = new LocalC[1000];
- for (int i = localCs.length; i-- > 0; ) {
- localCs[i] = new LocalC(localA, localB);
- }
-
- boolean exCaught = false;
- try {
- command.notifyListeners(localA);
- } catch (IllegalStateException ex) {
- if (ex.getMessage() == ISE_MESSAGE) {
- exCaught = true;
- } else {
- throw ex;
- }
- }
- assertFalse(exCaught);
-
- for (int i = localCs.length; i-- > 0; ) {
- assertFalse(localCs[i].isListeningToLocalA());
- }
- }
-
- private interface NotifyCommand {
- void notifyListeners(LocalA localA);
- }
-
- /**
- * This object simply fires a state change event. Both LocalB and LocalC
- * will be listeners.
- */
- private static class LocalA extends AbstractModel {
- LocalA() {
- super();
- }
- void notifyStateListeners() {
- this.fireStateChanged();
- }
- void notifyPropertyListeners() {
- this.firePropertyChanged("foo", 1, 2);
- }
- void notifyCollectionListeners() {
- this.fireCollectionChanged("foo");
- }
- void notifyListListeners() {
- this.fireListChanged("foo");
- }
- void notifyTreeListeners() {
- this.fireTreeChanged("foo");
- }
- }
-
- /**
- * This object will fire state change events whenever it receives
- * a state change event from localA.
- */
- private static class LocalB
- extends AbstractModel
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
- {
- LocalB(LocalA localA) {
- super();
- localA.addStateChangeListener(this);
- localA.addPropertyChangeListener(this);
- localA.addCollectionChangeListener(this);
- localA.addListChangeListener(this);
- localA.addTreeChangeListener(this);
- }
-
- public void stateChanged(StateChangeEvent e) {
- this.fireStateChanged();
- }
-
- public void propertyChanged(PropertyChangeEvent evt) {
- this.firePropertyChanged("bar", 1, 2);
- }
-
- public void collectionChanged(CollectionChangeEvent e) {
- this.fireCollectionChanged("bar");
- }
- public void collectionCleared(CollectionChangeEvent e) {/*ignore*/}
- public void itemsAdded(CollectionChangeEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionChangeEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- this.fireListChanged("bar");
- }
- public void listCleared(ListChangeEvent e) {/*ignore*/}
- public void itemsAdded(ListChangeEvent e) {/*ignore*/}
- public void itemsRemoved(ListChangeEvent e) {/*ignore*/}
- public void itemsReplaced(ListChangeEvent e) {/*ignore*/}
- public void itemsMoved(ListChangeEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- this.fireTreeChanged("bar");
- }
- public void treeCleared(TreeChangeEvent e) {/*ignore*/}
- public void nodeAdded(TreeChangeEvent e) {/*ignore*/}
- public void nodeRemoved(TreeChangeEvent e) {/*ignore*/}
-
- }
-
- /**
- * This object will listen to two other objects, localA and localB.
- * If this object receives notification from localB, it will stop listening to
- * localA. If this object receives notification from localA, it will check to
- * see whether it still listening to localA. If this object is no longer
- * listening to localA, it will complain about receiving the event and
- * throw an exception.
- */
- private static class LocalC
- extends AbstractModel
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
- {
- private LocalA localA;
- private LocalB localB;
- private boolean listeningToLocalA;
-
- LocalC(LocalA localA, LocalB localB) {
- super();
- this.localA = localA;
- this.localB = localB;
-
- localA.addStateChangeListener(this);
- localA.addPropertyChangeListener(this);
- localA.addCollectionChangeListener(this);
- localA.addListChangeListener(this);
- localA.addTreeChangeListener(this);
- this.listeningToLocalA = true;
-
- localB.addStateChangeListener(this);
- localB.addPropertyChangeListener(this);
- localB.addCollectionChangeListener(this);
- localB.addListChangeListener(this);
- localB.addTreeChangeListener(this);
- }
- boolean isListeningToLocalA() {
- return this.listeningToLocalA;
- }
-
- public void stateChanged(StateChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeStateChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removePropertyChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
-
- public void collectionChanged(CollectionChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeCollectionChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void collectionCleared(CollectionChangeEvent e) {/*ignore*/}
- public void itemsAdded(CollectionChangeEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionChangeEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeListChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void listCleared(ListChangeEvent e) {/*ignore*/}
- public void itemsAdded(ListChangeEvent e) {/*ignore*/}
- public void itemsRemoved(ListChangeEvent e) {/*ignore*/}
- public void itemsReplaced(ListChangeEvent e) {/*ignore*/}
- public void itemsMoved(ListChangeEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeTreeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void treeCleared(TreeChangeEvent e) {/*ignore*/}
- public void nodeAdded(TreeChangeEvent e) {/*ignore*/}
- public void nodeRemoved(TreeChangeEvent e) {/*ignore*/}
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java
deleted file mode 100644
index d77ba7e2e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model;
-
-import org.eclipse.jpt.utility.tests.internal.model.listener.JptUtilityModelListenerTests;
-import org.eclipse.jpt.utility.tests.internal.model.value.JptUtilityModelValueTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityModelListenerTests.suite());
- suite.addTest(JptUtilityModelValueTests.suite());
-
- suite.addTestSuite(AbstractModelTests.class);
- suite.addTestSuite(NewEventTests.class);
-
- return suite;
- }
-
- private JptUtilityModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java
deleted file mode 100644
index d50e13ec0e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-/**
- * test what it takes to add a new type of event to
- * model and change support
- */
-public class NewEventTests extends TestCase {
- private Foo foo;
-
- public NewEventTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Foo();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNoFooChangeListeners() {
- assertTrue(this.foo.hasNoFooChangeListeners());
- LocalListener listener = new LocalListener();
- this.foo.addFooChangeListener(listener);
- assertFalse(this.foo.hasNoFooChangeListeners());
- this.foo.removeFooChangeListener(listener);
- assertTrue(this.foo.hasNoFooChangeListeners());
- }
-
- public void testHasAnyFooChangeListeners() {
- assertFalse(this.foo.hasAnyFooChangeListeners());
- LocalListener listener = new LocalListener();
- this.foo.addFooChangeListener(listener);
- assertTrue(this.foo.hasAnyFooChangeListeners());
- this.foo.removeFooChangeListener(listener);
- assertFalse(this.foo.hasAnyFooChangeListeners());
- }
-
- public void testFireFooChangeEvent() {
- LocalListener listener = new LocalListener();
- assertFalse(listener.receivedFooEvent);
- this.foo.addFooChangeListener(listener);
- this.foo.foo();
- assertTrue(listener.receivedFooEvent);
- }
-
-
- // ********** harness classes **********
-
- class Foo extends AbstractFooModel {
- Foo() {
- super();
- }
- void foo() {
- this.fireFooChangeEvent();
- }
- }
-
- class LocalListener implements FooChangeListener {
- boolean receivedFooEvent = false;
- LocalListener() {
- super();
- }
- public void fooChanged(FooChangeEvent event) {
- this.receivedFooEvent = true;
- }
- }
-
- interface FooModel extends Model {
- void addFooChangeListener(FooChangeListener listener);
- void removeFooChangeListener(FooChangeListener listener);
- }
-
- interface FooChangeListener extends ChangeListener {
- void fooChanged(FooChangeEvent event);
- }
-
- static class FooChangeEvent extends ChangeEvent {
- private static final long serialVersionUID = 1L;
- public FooChangeEvent(FooModel source) {
- super(source);
- }
- @Override
- public String getAspectName() {
- return null; // the point of the event is that the name is unknown...
- }
- @Override
- public FooChangeEvent cloneWithSource(Model newSource) {
- return new FooChangeEvent((FooModel) newSource);
- }
- }
-
- static class AbstractFooModel extends AbstractModel implements FooModel {
- @Override
- protected synchronized FooChangeSupport getChangeSupport() {
- return (FooChangeSupport) super.getChangeSupport();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new FooChangeSupport(this);
- }
- public void addFooChangeListener(FooChangeListener listener) {
- this.getChangeSupport().addFooChangeListener(listener);
- }
- public void removeFooChangeListener(FooChangeListener listener) {
- this.getChangeSupport().removeFooChangeListener(listener);
- }
- protected void fireFooChangeEvent() {
- this.getChangeSupport().fireFooChanged();
- }
- public boolean hasAnyFooChangeListeners() {
- return this.getChangeSupport().hasAnyFooChangeListeners();
- }
- public boolean hasNoFooChangeListeners() {
- return ! this.hasAnyFooChangeListeners();
- }
- }
-
- static class FooChangeSupport extends ChangeSupport {
- FooChangeSupport(FooModel source) {
- super(source);
- }
- protected static final Class<FooChangeListener> FOO_CHANGE_LISTENER_CLASS = FooChangeListener.class;
- void addFooChangeListener(FooChangeListener listener) {
- this.addListener(FOO_CHANGE_LISTENER_CLASS, listener);
- }
- void removeFooChangeListener(FooChangeListener listener) {
- this.removeListener(FOO_CHANGE_LISTENER_CLASS, listener);
- }
- public boolean hasAnyFooChangeListeners() {
- return this.hasAnyListeners(FOO_CHANGE_LISTENER_CLASS);
- }
- private FooChangeListener[] fooChangeListeners() {
- return (FooChangeListener[]) this.listeners(FOO_CHANGE_LISTENER_CLASS);
- }
- public void fireFooChanged() {
- FooChangeListener[] targets = null;
- synchronized (this) {
- FooChangeListener[] fooChangeListeners = this.fooChangeListeners();
- if (fooChangeListeners != null) {
- targets = fooChangeListeners.clone();
- }
- }
- if (targets != null) {
- FooChangeEvent event = null;
- for (FooChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.fooChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new FooChangeEvent((FooModel) this.source);
- }
- target.fooChanged(event);
- }
- }
- }
- this.sourceChanged(null);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java
deleted file mode 100644
index 084a9b8ab3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelListenerTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelListenerTests.class.getPackage().getName());
-
- suite.addTestSuite(ReflectiveCollectionChangeListenerTests.class);
- suite.addTestSuite(ReflectiveListChangeListenerTests.class);
- suite.addTestSuite(ReflectivePropertyChangeListenerTests.class);
- suite.addTestSuite(ReflectiveStateChangeListenerTests.class);
- suite.addTestSuite(ReflectiveTreeChangeListenerTests.class);
-
- return suite;
- }
-
- private JptUtilityModelListenerTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
deleted file mode 100644
index ddd0bab630..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveCollectionChangeListenerTests extends TestCase {
-
- public ReflectiveCollectionChangeListenerTests(String name) {
- super(name);
- }
-
- private CollectionChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "collectionClearedZeroArgument", "collectionChangedZeroArgument");
- }
-
- private CollectionChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "collectionClearedSingleArgument", "collectionChangedSingleArgument");
- }
-
- public void testItemAddedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertTrue(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertTrue(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertTrue(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertTrue(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertTrue(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertTrue(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- boolean exCaught = false;
- try {
- CollectionChangeListener listener = ReflectiveChangeListener.buildCollectionChangeListener(target, "collectionChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- Method method = ClassTools.method(target, "collectionChangedDoubleArgument", new Class[] {CollectionChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- CollectionChangeListener listener = ReflectiveChangeListener.buildCollectionChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- // build a COLLECTION change listener and hack it so we
- // can add it as a LIST change listener
- Object listener = ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedSingleArgument");
- testModel.addListChangeListener((ListChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeList();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private Collection<String> strings = new ArrayList<String>();
- public static final String STRINGS_COLLECTION = "strings";
- TestModel() {
- super();
- }
- Iterator<String> strings() {
- return new CloneIterator<String>(this.strings) {
- @Override
- protected void remove(String s) {
- TestModel.this.removeString(s);
- }
- };
- }
- void addString(String string) {
- this.addItemToCollection(string, this.strings, STRINGS_COLLECTION);
- }
- void removeString(String string) {
- this.removeItemFromCollection(string, this.strings, STRINGS_COLLECTION);
- }
- void clearStrings() {
- this.clearCollection(this.strings, STRINGS_COLLECTION);
- }
- void replaceStrings(String[] newStrings) {
- this.strings.clear();
- CollectionTools.addAll(this.strings, newStrings);
- this.fireCollectionChanged(STRINGS_COLLECTION);
- }
- void changeList() {
- this.fireListChanged("bogus list");
- }
- }
-
- private class Target {
- TestModel testModel;
- String collectionName;
- String string;
- boolean itemAddedZeroArgumentFlag = false;
- boolean itemAddedSingleArgumentFlag = false;
- boolean itemRemovedZeroArgumentFlag = false;
- boolean itemRemovedSingleArgumentFlag = false;
- boolean collectionClearedZeroArgumentFlag = false;
- boolean collectionClearedSingleArgumentFlag = false;
- boolean collectionChangedZeroArgumentFlag = false;
- boolean collectionChangedSingleArgumentFlag = false;
- Target(TestModel testModel, String collectionName, String string) {
- super();
- this.testModel = testModel;
- this.collectionName = collectionName;
- this.string = string;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(CollectionChangeEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertEquals(this.string, e.items().next());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(CollectionChangeEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertEquals(this.string, e.items().next());
- }
- void collectionClearedZeroArgument() {
- this.collectionClearedZeroArgumentFlag = true;
- }
- void collectionClearedSingleArgument(CollectionChangeEvent e) {
- this.collectionClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertFalse(e.items().hasNext());
- }
- void collectionChangedZeroArgument() {
- this.collectionChangedZeroArgumentFlag = true;
- }
- void collectionChangedSingleArgument(CollectionChangeEvent e) {
- this.collectionChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertFalse(e.items().hasNext());
- }
- void collectionChangedDoubleArgument(CollectionChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
deleted file mode 100644
index f836aa76fa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveListChangeListenerTests extends TestCase {
-
- public ReflectiveListChangeListenerTests(String name) {
- super(name);
- }
-
- private ListChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "itemReplacedZeroArgument", "itemMovedZeroArgument", "listClearedZeroArgument", "listChangedZeroArgument");
- }
-
- private ListChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "itemReplacedSingleArgument", "itemMovedSingleArgument", "listClearedSingleArgument", "listChangedSingleArgument");
- }
-
- public void testItemAddedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedZeroArgument() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedSingleArgument() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertTrue(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertTrue(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedZeroArgument() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertTrue(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertTrue(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedSingleArgument() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertTrue(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertTrue(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertTrue(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertTrue(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertTrue(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertTrue(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertTrue(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertTrue(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertTrue(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertTrue(target.listChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- boolean exCaught = false;
- try {
- ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, "listChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- Method method = ClassTools.method(target, "listChangedDoubleArgument", new Class[] {ListChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- // build a LIST change listener and hack it so we
- // can add it as a COLLECTION change listener
- Object listener = ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument");
- testModel.addCollectionChangeListener((CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private List<String> strings = new ArrayList<String>();
- public static final String STRINGS_LIST = "strings";
- TestModel() {
- super();
- }
- ListIterator<String> strings() {
- return new CloneListIterator<String>(this.strings);
- }
- void addString(String string) {
- this.addItemToList(string, this.strings, STRINGS_LIST);
- }
- void removeString(String string) {
- this.removeItemFromList(this.strings.indexOf(string), this.strings, STRINGS_LIST);
- }
- void replaceString(String oldString, String newString) {
- this.setItemInList(this.strings.indexOf(oldString), newString, this.strings, STRINGS_LIST);
- }
- void moveString(int targetIndex, int sourceIndex) {
- this.moveItemInList(targetIndex, sourceIndex, this.strings, STRINGS_LIST);
- }
- void clearStrings() {
- this.clearList(this.strings, STRINGS_LIST);
- }
- void replaceAllStrings(String[] newStrings) {
- this.strings.clear();
- CollectionTools.addAll(this.strings, newStrings);
- this.fireListChanged(STRINGS_LIST);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection");
- }
- }
-
- private class Target {
- TestModel testModel;
- String listName;
- String string;
- int index;
- String replacedString;
- int sourceIndex;
- boolean itemAddedZeroArgumentFlag = false;
- boolean itemAddedSingleArgumentFlag = false;
- boolean itemRemovedZeroArgumentFlag = false;
- boolean itemRemovedSingleArgumentFlag = false;
- boolean itemReplacedZeroArgumentFlag = false;
- boolean itemReplacedSingleArgumentFlag = false;
- boolean itemMovedZeroArgumentFlag = false;
- boolean itemMovedSingleArgumentFlag = false;
- boolean listClearedZeroArgumentFlag = false;
- boolean listClearedSingleArgumentFlag = false;
- boolean listChangedZeroArgumentFlag = false;
- boolean listChangedSingleArgumentFlag = false;
- Target(TestModel testModel, String listName, String string, int index) {
- super();
- this.testModel = testModel;
- this.listName = listName;
- this.string = string;
- this.index = index;
- }
- Target(TestModel testModel, String listName, String string, int index, String replacedString) {
- this(testModel, listName, string, index);
- this.replacedString = replacedString;
- }
- Target(TestModel testModel, String listName, int targetIndex, int sourceIndex) {
- super();
- this.testModel = testModel;
- this.listName = listName;
- this.index = targetIndex;
- this.sourceIndex = sourceIndex;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(ListChangeEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(ListChangeEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemReplacedZeroArgument() {
- this.itemReplacedZeroArgumentFlag = true;
- }
- void itemReplacedSingleArgument(ListChangeEvent e) {
- this.itemReplacedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.replacedString, e.replacedItems().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemMovedZeroArgument() {
- this.itemMovedZeroArgumentFlag = true;
- }
- void itemMovedSingleArgument(ListChangeEvent e) {
- this.itemMovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.index, e.getTargetIndex());
- assertEquals(this.sourceIndex, e.getSourceIndex());
- }
- void listChangedZeroArgument() {
- this.listChangedZeroArgumentFlag = true;
- }
- void listClearedSingleArgument(ListChangeEvent e) {
- this.listClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertFalse(e.items().hasNext());
- assertEquals(this.index, e.getIndex());
- }
- void listClearedZeroArgument() {
- this.listClearedZeroArgumentFlag = true;
- }
- void listChangedSingleArgument(ListChangeEvent e) {
- this.listChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertFalse(e.items().hasNext());
- assertEquals(this.index, e.getIndex());
- }
- void listChangedDoubleArgument(ListChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
deleted file mode 100644
index 2286225afa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectivePropertyChangeListenerTests extends TestCase {
-
- public ReflectivePropertyChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgument() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedZeroArgument"));
- testModel.setValue(99);
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testZeroArgumentNamedProperty() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedZeroArgument"));
- testModel.setValue(99);
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testSingleArgument() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument"));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgument2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ClassTools.method(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, method));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testSingleArgumentNamedProperty() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument"));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgumentNamedProperty2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ClassTools.method(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, method));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- // build a PROPERTY change listener and hack it so we
- // can add it as a STATE change listener
- Object listener = ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument");
- testModel.addStateChangeListener((StateChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.setValue(99);
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- boolean exCaught = false;
- try {
- PropertyChangeListener listener = ReflectiveChangeListener.buildPropertyChangeListener(target, "stateChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ClassTools.method(target, "propertyChangedDoubleArgument", new Class[] {PropertyChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- PropertyChangeListener listener = ReflectiveChangeListener.buildPropertyChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private int value = 0;
- public static final String VALUE_PROPERTY = "value";
- TestModel(int value) {
- super();
- this.value = value;
- }
- void setValue(int value) {
- int old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- if (old != value) {
- this.fireStateChanged();
- }
- }
- }
-
- private class Target {
- TestModel testModel;
- String propertyName;
- Object oldValue;
- Object newValue;
- boolean zeroArgumentFlag = false;
- boolean singleArgumentFlag = false;
- Target(TestModel testModel, String propertyName, int oldValue, int newValue) {
- super();
- this.testModel = testModel;
- this.propertyName = propertyName;
- this.oldValue = new Integer(oldValue);
- this.newValue = new Integer(newValue);
- }
- void propertyChangedZeroArgument() {
- this.zeroArgumentFlag = true;
- }
- void propertyChangedSingleArgument(PropertyChangeEvent e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.propertyName, e.getPropertyName());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- }
- void propertyChangedSingleArgument2(Object o) {
- PropertyChangeEvent e = (PropertyChangeEvent) o;
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.propertyName, e.getPropertyName());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- }
- void propertyChangedDoubleArgument(PropertyChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
deleted file mode 100644
index 6230b1c644..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveStateChangeListenerTests extends TestCase {
-
- public ReflectiveStateChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgument() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedZeroArgument"));
- testModel.changeState();
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testSingleArgument() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedSingleArgument"));
- testModel.changeState();
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- Method method = ClassTools.method(target, "stateChangedSingleArgument2", new Class[] {Object.class});
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, method));
- testModel.changeState();
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- // build a STATE change listener and hack it so we
- // can add it as a PROPERTY change listener
- Object listener = ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedSingleArgument");
- testModel.addPropertyChangeListener((PropertyChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeProperty();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- boolean exCaught = false;
- try {
- StateChangeListener listener = ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- Method method = ClassTools.method(target, "stateChangedDoubleArgument", new Class[] {StateChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- StateChangeListener listener = ReflectiveChangeListener.buildStateChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- TestModel() {
- super();
- }
- void changeState() {
- this.fireStateChanged();
- }
- void changeProperty() {
- this.firePropertyChanged("value", 55, 42);
- }
- }
-
- private class Target {
- TestModel testModel;
- boolean zeroArgumentFlag = false;
- boolean singleArgumentFlag = false;
- Target(TestModel testModel) {
- super();
- this.testModel = testModel;
- }
- void stateChangedZeroArgument() {
- this.zeroArgumentFlag = true;
- }
- void stateChangedSingleArgument(StateChangeEvent e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- }
- void stateChangedSingleArgument2(Object e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, ((StateChangeEvent) e).getSource());
- }
- void stateChangedDoubleArgument(StateChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
deleted file mode 100644
index b97c785ea8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveTreeChangeListenerTests extends TestCase {
-
- public ReflectiveTreeChangeListenerTests(String name) {
- super(name);
- }
-
- private TreeChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedZeroArgument", "nodeRemovedZeroArgument", "treeClearedZeroArgument", "treeChangedZeroArgument");
- }
-
- private TreeChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedSingleArgument", "nodeRemovedSingleArgument", "treeClearedSingleArgument", "treeChangedSingleArgument");
- }
-
- public void testNodeAddedZeroArgument() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.addNode("root", "child");
- assertTrue(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.addNode("root", "child");
- assertTrue(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedSingleArgument() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.addNode("root", "child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertTrue(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.addNode("root", "child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertTrue(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertTrue(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertTrue(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertTrue(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertTrue(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertTrue(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertTrue(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertTrue(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertTrue(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertTrue(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertTrue(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertTrue(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertTrue(target.treeChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- boolean exCaught = false;
- try {
- TreeChangeListener listener = ReflectiveChangeListener.buildTreeChangeListener(target, "collectionChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- Method method = ClassTools.method(target, "collectionChangedDoubleArgument", new Class[] {TreeChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- TreeChangeListener listener = ReflectiveChangeListener.buildTreeChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- // build a TREE change listener and hack it so we
- // can add it as a COLLECTION change listener
- Object listener = ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedSingleArgument");
- testModel.addCollectionChangeListener((CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private final String root;
- private Map<String, Collection<String>> childrenLists = new HashMap<String, Collection<String>>();
- private Map<String, String> parents = new HashMap<String, String>();
- public static final String STRINGS_TREE = "strings";
- TestModel(String root) {
- super();
- if (root == null) {
- throw new NullPointerException();
- }
- this.root = root;
- this.childrenLists.put(root, new ArrayList<String>());
- this.parents.put(root, null);
- }
- String getRoot() {
- return this.root;
- }
- private String[] path(String node) {
- String temp = node;
- List<String> reversePath = new ArrayList<String>();
- do {
- reversePath.add(temp);
- temp = this.parents.get(temp);
- } while (temp != null);
- return CollectionTools.reverse(reversePath).toArray(new String[reversePath.size()]);
- }
- Iterator<String> strings() {
- return new CloneIterator<String>(this.childrenLists.keySet()) {
- @Override
- protected void remove(String s) {
- TestModel.this.removeNode(s);
- }
- };
- }
- void addNode(String parent, String child) {
- if ((parent == null) || (child == null)) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.get(parent);
- if (children == null) {
- throw new IllegalStateException("cannot add a child to a non-existent parent");
- }
-
- if (this.childrenLists.get(child) != null) {
- throw new IllegalStateException("cannot add a child that is already in the tree");
- }
-
- children.add(child);
- this.childrenLists.put(child, new ArrayList<String>());
- this.parents.put(child, parent);
- this.fireNodeAdded(STRINGS_TREE, this.path(child));
- }
- void removeNode(String node) {
- if (node == null) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.get(node);
- if (children == null) {
- throw new IllegalStateException("node is not in tree");
- }
- Object[] path = this.path(node);
- for (String s : children) {
- this.removeNode(s);
- }
- this.childrenLists.remove(node);
- this.parents.remove(node);
- this.fireNodeRemoved(STRINGS_TREE, path);
- }
- void replaceNode(String oldNode, String newNode) {
- if ((oldNode == null) || (newNode == null)) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.remove(oldNode);
- if (children == null) {
- throw new IllegalStateException("old node is not in tree");
- }
- this.childrenLists.put(newNode, children);
- for (String child : children) {
- this.parents.put(child, newNode);
- }
-
- String parent = this.parents.remove(oldNode);
- this.parents.put(newNode, parent);
-
- this.fireTreeChanged(STRINGS_TREE, this.path(newNode));
- }
- void clearTree() {
- this.childrenLists.clear();
- this.childrenLists.put(root, new ArrayList<String>());
- this.parents.clear();
- this.parents.put(root, null);
- this.fireTreeCleared(STRINGS_TREE);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection");
- }
- }
-
- private class Target {
- TestModel testModel;
- String treeName;
- String[] path;
- boolean nodeAddedZeroArgumentFlag = false;
- boolean nodeAddedSingleArgumentFlag = false;
- boolean nodeRemovedZeroArgumentFlag = false;
- boolean nodeRemovedSingleArgumentFlag = false;
- boolean treeClearedZeroArgumentFlag = false;
- boolean treeClearedSingleArgumentFlag = false;
- boolean treeChangedZeroArgumentFlag = false;
- boolean treeChangedSingleArgumentFlag = false;
- Target(TestModel testModel, String treeName, String[] path) {
- super();
- this.testModel = testModel;
- this.treeName = treeName;
- this.path = path;
- }
- void nodeAddedZeroArgument() {
- this.nodeAddedZeroArgumentFlag = true;
- }
- void nodeAddedSingleArgument(TreeChangeEvent e) {
- this.nodeAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void nodeRemovedZeroArgument() {
- this.nodeRemovedZeroArgumentFlag = true;
- }
- void nodeRemovedSingleArgument(TreeChangeEvent e) {
- this.nodeRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void treeClearedZeroArgument() {
- this.treeClearedZeroArgumentFlag = true;
- }
- void treeClearedSingleArgument(TreeChangeEvent e) {
- this.treeClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void treeChangedZeroArgument() {
- this.treeChangedZeroArgumentFlag = true;
- }
- void treeChangedSingleArgument(TreeChangeEvent e) {
- this.treeChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertTrue(Arrays.equals(this.path, e.getPath()));
- }
- void collectionChangedDoubleArgument(TreeChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
deleted file mode 100644
index 43cf94fdac..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Date;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class BufferedWritablePropertyValueModelTests extends TestCase {
- private Employee employee;
- private WritablePropertyValueModel<Employee> employeeHolder;
- PropertyChangeEvent employeeEvent;
-
- private WritablePropertyValueModel<Integer> idAdapter;
- private WritablePropertyValueModel<String> nameAdapter;
- private WritablePropertyValueModel<Date> hireDateAdapter;
- PropertyChangeEvent adapterEvent;
-
- private BufferedWritablePropertyValueModel.Trigger trigger;
- private WritablePropertyValueModel<Integer> bufferedIDHolder;
- private WritablePropertyValueModel<String> bufferedNameHolder;
- private WritablePropertyValueModel<Date> bufferedHireDateHolder;
- PropertyChangeEvent bufferedEvent;
-
- public BufferedWritablePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.employee = new Employee(17, "Freddy", new Date());
- this.employeeHolder = new SimplePropertyValueModel<Employee>(this.employee);
-
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
-
- this.idAdapter = this.buildIDAdapter(this.employeeHolder);
- this.bufferedIDHolder = new BufferedWritablePropertyValueModel<Integer>(this.idAdapter, this.trigger);
-
- this.nameAdapter = this.buildNameAdapter(this.employeeHolder);
- this.bufferedNameHolder = new BufferedWritablePropertyValueModel<String>(this.nameAdapter, this.trigger);
-
- this.hireDateAdapter = this.buildHireDateAdapter(this.employeeHolder);
- this.bufferedHireDateHolder = new BufferedWritablePropertyValueModel<Date>(this.hireDateAdapter, this.trigger);
- }
-
- private WritablePropertyValueModel<Integer> buildIDAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, Integer>(eHolder, Employee.ID_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getID());
- }
- @Override
- protected void setValue_(Integer value) {
- this.subject.setID(value.intValue());
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNameAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, String>(eHolder, Employee.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Date> buildHireDateAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, Date>(eHolder, Employee.HIRE_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getHireDate();
- }
- @Override
- protected void setValue_(Date value) {
- this.subject.setHireDate(value);
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(17), this.bufferedIDHolder.getValue());
-
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Freddy", this.bufferedNameHolder.getValue());
-
- Date temp = this.employee.getHireDate();
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(temp, this.bufferedHireDateHolder.getValue());
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
- }
-
- public void testAccept() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- Date temp = this.employee.getHireDate();
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
-
- this.trigger.accept();
-
- assertEquals(323, this.employee.getID());
- assertEquals(new Integer(323), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- assertEquals("Ripley", this.employee.getName());
- assertEquals("Ripley", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- assertEquals(null, this.employee.getHireDate());
- assertEquals(null, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
- }
-
- public void testReset() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- Date temp = this.employee.getHireDate();
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
-
- this.trigger.reset();
-
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(17), this.bufferedIDHolder.getValue());
-
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Freddy", this.bufferedNameHolder.getValue());
-
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(temp, this.bufferedHireDateHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
-
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
-
- this.bufferedIDHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
- }
-
- public void testPropertyChange1() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- PropertyChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, adapterListener);
-
- PropertyChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addPropertyChangeListener(Employee.NAME_PROPERTY, employeeListener);
-
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(bufferedListener);
-
- PropertyChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addPropertyChangeListener(adapterListener);
-
- PropertyChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addPropertyChangeListener(employeeListener);
-
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Ripley");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Freddy", "Ripley");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Charlie");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Ripley", "Charlie");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.trigger.accept();
- assertNull(this.bufferedEvent);
- this.verifyEvent(this.adapterEvent, this.nameAdapter, PropertyValueModel.VALUE, "Freddy", "Charlie");
- this.verifyEvent(this.employeeEvent, this.employee, Employee.NAME_PROPERTY, "Freddy", "Charlie");
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Jason");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Charlie", "Jason");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.trigger.reset();
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Jason", "Charlie");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
- }
-
- private PropertyChangeListener buildBufferedListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.bufferedEvent = e;
- }
- };
- }
-
- private PropertyChangeListener buildAdapterListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.adapterEvent = e;
- }
- };
- }
-
- private PropertyChangeListener buildEmployeeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.employeeEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent event, Object source, String propertyName, Object oldValue, Object newValue) {
- assertEquals(source, event.getSource());
- assertEquals(propertyName, event.getPropertyName());
- assertEquals(oldValue, event.getOldValue());
- assertEquals(newValue, event.getNewValue());
- }
-
-
- // ********** inner class **********
-
- private class Employee extends AbstractModel {
- private int id;
- public static final String ID_PROPERTY = "id";
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Date hireDate;
- public static final String HIRE_DATE_PROPERTY = "hireDate";
-
- Employee(int id, String name, Date hireDate) {
- super();
- this.id = id;
- this.name = name;
- this.hireDate = hireDate;
- }
- int getID() {
- return this.id;
- }
- void setID(int id) {
- int old = this.id;
- this.id = id;
- this.firePropertyChanged(ID_PROPERTY, old, id);
- }
- String getName() {
- return this.name;
- }
- void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- Date getHireDate() {
- return this.hireDate;
- }
- void setHireDate(Date hireDate) {
- Object old = this.hireDate;
- this.hireDate = hireDate;
- this.firePropertyChanged(HIRE_DATE_PROPERTY, old, hireDate);
- }
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java
deleted file mode 100644
index 62c56b993f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CachingTransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CachingTransformationPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<Person> objectHolder;
- PropertyChangeEvent event;
-
- private PropertyValueModel<Person> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public CachingTransformationPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<Person>(new Person("Karen", "Peggy", null));
- this.transformationObjectHolder = new CachingTransformationPropertyValueModel<Person, Person>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<Person, Person> buildTransformer() {
- return new BidiTransformer<Person, Person>() {
- public Person transform(Person p) {
- return (p == null) ? null : p.getParent();
- }
- public Person reverseTransform(Person p) {
- return (p == null) ? null : p.getChild();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
-
- Person person = this.objectHolder.getValue();
- assertEquals("Karen", person.getName());
- Person parent = this.transformationObjectHolder.getValue();
- assertEquals(person.getParent().getName(), parent.getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent, this.transformationObjectHolder.getValue());
-
- Person person1 = new Person("Matt", "Mitch", null);
- this.objectHolder.setValue(person1);
- Person parent2 = this.transformationObjectHolder.getValue();
- assertEquals(person1.getParent().getName(), parent2.getName());
- assertNotSame(person1.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent2, this.transformationObjectHolder.getValue());
-
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- Person person3 = new Person("Karen", "Peggy", null);
- this.objectHolder.setValue(person3);
- assertEquals("Karen", person3.getName());
- Person parent3 = this.transformationObjectHolder.getValue();
- assertEquals(person3.getParent().getName(), parent3.getName());
- assertNotSame(person3.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent3, this.transformationObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- Person karen = this.objectHolder.getValue();
- Person peggyParent = this.transformationObjectHolder.getValue();
- Person peggy = new Person("Peggy", "Marian", null);
- this.objectHolder.setValue(peggy);
- Person marianParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, karen, peggy);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, peggyParent, marianParent);
-
- this.event = null;
- this.transformationEvent = null;
- Person matt = new Person("Matt", "Mitch", null);
- this.objectHolder.setValue(matt);
- Person mitchParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, peggy, matt);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, marianParent, mitchParent);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, matt, null);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, mitchParent, null);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(matt);
- mitchParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, null, matt);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, mitchParent);
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationPropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-
- private class Person extends AbstractModel {
-
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- private String parentName;
- public static final String PARENT_NAME_PROPERTY = "parentName";
-
- private Person child;
-
- public Person(String name, String parentName, Person child) {
- this.name = name;
- this.parentName = parentName;
- this.child = child;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public Person getParent() {
- return new Person(this.parentName, null, this);
- }
-
- public String getParentName() {
- return this.parentName;
- }
-
- public void setParentName(String newParentName) {
- String oldParentName = this.parentName;
- this.parentName = newParentName;
- firePropertyChanged(PARENT_NAME_PROPERTY, oldParentName, newParentName);
- }
-
- public Person getChild() {
- return this.child;
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
deleted file mode 100644
index 72fd1288c3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CachingTransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("nls")
-public class CachingTransformationWritablePropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<Person> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<Person> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public CachingTransformationWritablePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<Person>(new Person("Karen", "Peggy", null));
- this.transformationObjectHolder = new CachingTransformationWritablePropertyValueModel<Person, Person>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<Person, Person> buildTransformer() {
- return new BidiTransformer<Person, Person>() {
- public Person transform(Person p) {
- return (p == null) ? null : p.getParent();
- }
- public Person reverseTransform(Person p) {
- return (p == null) ? null : p.getChild();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
-
-
- Person person = this.objectHolder.getValue();
- assertEquals("Karen", person.getName());
- Person parent = this.transformationObjectHolder.getValue();
- assertEquals(person.getParent().getName(), parent.getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent, this.transformationObjectHolder.getValue());
-
- Person person1 = new Person("Matt", "Mitch", null);
- this.objectHolder.setValue(person1);
- Person parent2 = this.transformationObjectHolder.getValue();
- assertEquals(person1.getParent().getName(), parent2.getName());
- assertNotSame(person1.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent2, this.transformationObjectHolder.getValue());
-
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- Person person3 = new Person("Karen", "Peggy", null);
- this.objectHolder.setValue(person3);
- assertEquals("Karen", person3.getName());
- Person parent3 = this.transformationObjectHolder.getValue();
- assertEquals(person3.getParent().getName(), parent3.getName());
- assertNotSame(person3.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent3, this.transformationObjectHolder.getValue());
- }
-
- public void testSetValue() {
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
-
- Person person = new Person("Chris", "Noel", null);
- this.transformationObjectHolder.setValue(person.getParent());
- assertEquals(person, this.objectHolder.getValue());
- assertEquals(person.getParent().getName(), this.transformationObjectHolder.getValue().getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
-
- Person person2 = new Person("Jon", "Elizabeth", null);
- this.transformationObjectHolder.setValue(person2.getParent());
- assertEquals(person2, this.objectHolder.getValue());
- assertEquals(person2.getParent().getName(), this.transformationObjectHolder.getValue().getName());
- assertNotSame(person2.getParent(), this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue(person.getParent());
- assertEquals(person, this.objectHolder.getValue());
- assertEquals(person.getParent().getName(), this.transformationObjectHolder.getValue().getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- Person oldPerson = this.objectHolder.getValue();
- Person oldParent = this.transformationObjectHolder.getValue();
- Person newPerson = new Person("Karen" , "Peggy", null);
- this.objectHolder.setValue(newPerson);
- Person newParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, oldPerson, newPerson);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, oldParent, newParent);
-
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue("Foo");
-// this.verifyEvent(this.event, this.objectHolder, "baz", "Foo");
-// this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAZ", "FOO");
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue("FOO");
-// this.verifyEvent(this.event, this.objectHolder, "Foo", "FOO");
-// assertNull(this.transformationEvent);
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue(null);
-// this.verifyEvent(this.event, this.objectHolder, "FOO", null);
-// this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", null);
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue("bar");
-// this.verifyEvent(this.event, this.objectHolder, null, "bar");
-// this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, "BAR");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationWritablePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationWritablePropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-
- private class Person extends AbstractModel {
-
- private String name;
- public static final String NAME_PROPERTY = "nameProperty";
-
- private String parentName;
- public static final String PARENT_NAME_PROPERTY = "parentNameProperty";
-
- private Person child;
-
- public Person(String name, String parentName, Person child) {
- this.name = name;
- this.parentName = parentName;
- this.child = child;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public Person getParent() {
- return new Person(this.parentName, null, this);
- }
-
- public String getParentName() {
- return this.parentName;
- }
-
- public void setParentName(String newParentName) {
- String oldParentName = this.parentName;
- this.parentName = newParentName;
- firePropertyChanged(PARENT_NAME_PROPERTY, oldParentName, newParentName);
- }
-
- public Person getChild() {
- return this.child;
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
deleted file mode 100644
index 430d71c603..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CollectionAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalCollectionAspectAdapter aa1;
- private CollectionChangeEvent event1;
- private CollectionChangeListener listener1;
- private String event1Type;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String CHANGE = "change";
- private static final String CLEAR = "clear";
-
- private TestSubject subject2;
-
- public CollectionAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- this.subject1.addNames(this.subject1Names());
- this.subject1.addDescriptions(this.subject1Descriptions());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addCollectionChangeListener(CollectionValueModel.VALUES, this.listener1);
- this.event1 = null;
- this.event1Type = null;
-
- this.subject2 = new TestSubject();
- this.subject2.addNames(this.subject2Names());
- this.subject2.addDescriptions(this.subject2Descriptions());
- }
-
- private Collection<String> subject1Names() {
- Collection<String> result = new HashBag<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private Collection<String> subject1Descriptions() {
- Collection<String> result = new HashBag<String>();
- result.add("this.subject1 description1");
- result.add("this.subject1 description2");
- return result;
- }
-
- private Collection<String> subject2Names() {
- Collection<String> result = new HashBag<String>();
- result.add("baz");
- result.add("bam");
- return result;
- }
-
- private Collection<String> subject2Descriptions() {
- Collection<String> result = new HashBag<String>();
- result.add("this.subject2 description1");
- result.add("this.subject2 description2");
- return result;
- }
-
- private LocalCollectionAspectAdapter buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new LocalCollectionAspectAdapter(subjectHolder);
- }
-
- private CollectionChangeListener buildValueChangeListener1() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, ADD);
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, REMOVE);
- }
- public void collectionCleared(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CLEAR);
- }
- public void collectionChanged(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CHANGE);
- }
- };
- }
-
- void value1Changed(CollectionChangeEvent e, String eventType) {
- this.event1 = e;
- this.event1Type = eventType;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject2Names(), CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertFalse(this.event1.items().hasNext());
- assertFalse((this.aa1.iterator()).hasNext());
-
- this.event1 = null;
- this.event1Type = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.addName("jam");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, ADD);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("jam", this.event1.items().next());
- Collection<String> namesPlus = this.subject1Names();
- namesPlus.add("jam");
- assertEquals(namesPlus, CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.aa1.addAll(Collections.singleton("jaz"));
- assertNotNull(this.event1);
- assertEquals(this.event1Type, ADD);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("jaz", this.event1.items().next());
- namesPlus.add("jaz");
- assertEquals(namesPlus, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.removeName("foo");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, REMOVE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("foo", this.event1.items().next());
- Collection<String> namesMinus = this.subject1Names();
- namesMinus.remove("foo");
- assertEquals(namesMinus, CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.aa1.removeAll(Collections.singleton("bar"));
- assertNotNull(this.event1);
- assertEquals(this.event1Type, REMOVE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("bar", this.event1.items().next());
- namesMinus.remove("bar");
- assertEquals(namesMinus, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testCollectionChange() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.addTwoNames("jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertFalse(this.event1.items().hasNext());
- Collection<String> namesPlus2 = this.subject1Names();
- namesPlus2.add("jam");
- namesPlus2.add("jaz");
- assertEquals(namesPlus2, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.subject1.names()));
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.names()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.aa1.iterator()));
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeCollectionChangeListener(CollectionValueModel.VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- assertFalse(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- CollectionChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addCollectionChangeListener(listener2);
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeCollectionChangeListener(listener2);
- assertFalse(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- assertFalse(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private Collection<String> names;
- public static final String NAMES_COLLECTION = "names";
- private Collection<String> descriptions;
- public static final String DESCRIPTIONS_COLLECTION = "descriptions";
-
- public TestSubject() {
- this.names = new HashBag<String>();
- this.descriptions = new HashBag<String>();
- }
- public Iterator<String> names() {
- return new ReadOnlyIterator<String>(this.names);
- }
- public void addName(String name) {
- if (this.names.add(name)) {
- this.fireItemAdded(NAMES_COLLECTION, name);
- }
- }
- public void addNames(Iterator<String> newNames) {
- while (newNames.hasNext()) {
- this.addName(newNames.next());
- }
- }
- public void addNames(Collection<String> newNames) {
- this.addNames(newNames.iterator());
- }
- public void addTwoNames(String name1, String name2) {
- if (this.names.add(name1) | this.names.add(name2)) {
- this.fireCollectionChanged(NAMES_COLLECTION);
- }
- }
- public void removeName(String name) {
- if (this.names.remove(name)) {
- this.fireItemRemoved(NAMES_COLLECTION, name);
- }
- }
- public Iterator<String> descriptions() {
- return new ReadOnlyIterator<String>(this.descriptions);
- }
- public void addDescription(String description) {
- if (this.descriptions.add(description)) {
- this.fireItemAdded(DESCRIPTIONS_COLLECTION, description);
- }
- }
- public void addDescriptions(Iterator<String> newDescriptions) {
- while (newDescriptions.hasNext()) {
- this.addDescription(newDescriptions.next());
- }
- }
- public void addDescriptions(Collection<String> newDescriptions) {
- this.addDescriptions(newDescriptions.iterator());
- }
- public void removeDescription(String description) {
- if (this.descriptions.remove(description)) {
- this.fireItemRemoved(DESCRIPTIONS_COLLECTION, description);
- }
- }
- }
-
- // this is not a typical aspect adapter - the value is determined by the aspect name
- private class LocalCollectionAspectAdapter extends CollectionAspectAdapter<TestSubject, String> {
-
- LocalCollectionAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- super(subjectHolder, TestSubject.NAMES_COLLECTION);
- }
-
- @Override
- protected Iterator<String> iterator_() {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- return this.subject.names();
- }
- if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- return this.subject.descriptions();
- }
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
-
- public void add(String item) {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- this.subject.addName(item);
- } else if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- this.subject.addDescription(item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
- }
-
- public void addAll(Collection<String> items) {
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- this.add(stream.next());
- }
- }
-
- public void remove(Object item) {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- this.subject.removeName((String) item);
- } else if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- this.subject.removeDescription((String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
- }
-
- public void removeAll(Collection<String> items) {
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- this.remove(stream.next());
- }
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
deleted file mode 100644
index a4c4e23918..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CollectionListValueModelAdapterTests extends TestCase {
- private ListValueModel<String> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- private Collection<String> wrappedCollection;
-
- public CollectionListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollection = new HashBag<String>();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>(this.wrappedCollection);
- this.adapter = new CollectionListValueModelAdapter<String>(this.wrappedCollectionHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- private Collection<String> adapterCollection() {
- return CollectionTools.collection(this.adapter.iterator());
- }
-
- public void testStaleValue() {
- ListChangeListener listener = new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- };
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
-
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterCollection = this.adapterCollection();
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- public void testAdd() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testRemove() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertTrue(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testCollectionChangedToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedCollectionHolder.setCollection(new HashBag<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- bag.add("foo");
- bag.add("bar");
- this.wrappedCollectionHolder.setCollection(bag);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- this.wrappedCollectionHolder.setCollection(bag);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
deleted file mode 100644
index 80f4626dec..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CollectionPropertyValueModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Boolean> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- PropertyChangeEvent event;
-
- public CollectionPropertyValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>();
- this.adapter = new LocalAdapter(this.wrappedCollectionHolder, "666");
- this.event = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private boolean booleanValue() {
- return this.adapter.getValue().booleanValue();
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(this.wrappedCollectionHolder.iterator());
- }
-
- public void testValue() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- });
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.add("111");
- assertFalse(this.booleanValue());
-
- this.wrappedCollectionHolder.add("222");
- assertFalse(this.booleanValue());
-
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.remove("666");
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.clear();
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
- }
-
- public void testSetValue() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- });
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.adapter.setValue(Boolean.TRUE);
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.setValue(Boolean.FALSE);
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
- }
-
- public void testEventFiring() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CollectionPropertyValueModelAdapterTests.this.event = e;
- }
- });
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("111");
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("222");
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("666");
- this.verifyEvent(false, true);
-
- this.wrappedCollectionHolder.remove("666");
- this.verifyEvent(true, false);
-
- this.wrappedCollectionHolder.add("666");
- this.verifyEvent(false, true);
-
- this.wrappedCollectionHolder.clear();
- this.verifyEvent(true, false);
- }
-
- private void verifyEvent(boolean oldValue, boolean newValue) {
- assertEquals(this.adapter, this.event.getSource());
- assertEquals(Boolean.valueOf(oldValue), this.event.getOldValue());
- assertEquals(Boolean.valueOf(newValue), this.event.getNewValue());
- this.event = null;
- }
-
- public void testStaleValue() {
- PropertyChangeListener listener = new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- };
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- PropertyChangeListener listener = new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- };
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removePropertyChangeListener(listener);
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
-
- // ********** member class **********
-
- /**
- * the value is true if the wrapped collection contains the specified item,
- * otherwise the value is false
- */
- private static class LocalAdapter
- extends CollectionPropertyValueModelAdapter<Boolean>
- implements WritablePropertyValueModel<Boolean>
- {
- private String item;
-
- LocalAdapter(CollectionValueModel<String> collectionHolder, String item) {
- super(collectionHolder);
- this.item = item;
- }
-
- // ********** CollectionPropertyValueModelAdapter implementation **********
- /**
- * always return a Boolean
- */
- @Override
- public Boolean getValue() {
- Boolean result = super.getValue();
- return (result == null) ? Boolean.FALSE : result;
- }
- @SuppressWarnings("unchecked")
- public void setValue(Boolean value) {
- if (this.booleanValue()) {
- if ( ! this.booleanValueOf(value)) {
- // the value is changing from true to false
- ((SimpleCollectionValueModel<String>) this.collectionHolder).remove(this.item);
- }
- } else {
- if (this.booleanValueOf(value)) {
- // the value is changing from false to true
- ((SimpleCollectionValueModel<String>) this.collectionHolder).add(this.item);
- }
- }
- }
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(CollectionTools.contains(this.collectionHolder.iterator(), this.item));
- }
-
- // ********** internal methods **********
- private boolean booleanValue() {
- return this.booleanValueOf(this.value);
- }
- private boolean booleanValueOf(Object b) {
- return (b == null) ? false : ((Boolean) b).booleanValue();
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
deleted file mode 100644
index 90f4b6ff0b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CompositeCollectionValueModelTests extends TestCase {
- private Neighborhood neighborhood;
- private WritablePropertyValueModel<Neighborhood> neighborhoodHolder;
-
- public CompositeCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.neighborhood = new Neighborhood("Hanna-Barbera");
- this.neighborhoodHolder = new SimplePropertyValueModel<Neighborhood>(this.neighborhood);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSynch1() {
- this.verifySynch(this.buildAllMembersComposite(this.neighborhoodHolder));
- }
-
- public void testSynch2() {
- this.verifySynch(this.buildAllMembersComposite2(this.neighborhoodHolder));
- }
-
- private void verifySynch(CollectionValueModel<Member> compositeCVM) {
- assertEquals(0, CollectionTools.size(compositeCVM.iterator()));
- Bag<Family> familiesSynch = new CoordinatedBag<Family>(this.buildFamiliesAspectAdapter(this.neighborhoodHolder));
- Bag<Member> membersSynch = new CoordinatedBag<Member>(compositeCVM);
- this.populateNeighborhood(this.neighborhood);
-
- Family jetsons = this.neighborhood.familyNamed("Jetson");
-
- assertEquals(3, familiesSynch.size());
- assertEquals(12, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(12, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.removeMember(jetsons.memberNamed("Astro"));
- assertEquals(3, familiesSynch.size());
- assertEquals(11, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(11, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.removeMember(jetsons.memberNamed("Judy"));
- assertEquals(3, familiesSynch.size());
- assertEquals(10, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(10, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.addMember("Fido");
- assertEquals(3, familiesSynch.size());
- assertEquals(11, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(11, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- this.neighborhood.removeFamily(jetsons);
- assertEquals(2, familiesSynch.size());
- assertEquals(7, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(7, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- Family bears = this.neighborhood.addFamily("Bear");
- bears.addMember("Yogi");
- assertEquals(3, familiesSynch.size());
- assertEquals(8, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(8, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- bears.addMember("Boo-Boo");
- assertEquals(3, familiesSynch.size());
- assertEquals(9, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(9, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- Neighborhood n2 = new Neighborhood("Hanna-Barbera 2");
- this.neighborhoodHolder.setValue(n2);
- this.populateNeighborhood(n2);
- assertEquals(3, familiesSynch.size());
- assertEquals(12, CollectionTools.size(n2.allMembers()));
- assertEquals(12, membersSynch.size());
- assertEquals(CollectionTools.bag(n2.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
- }
-
- public void testNoTransformer() {
- SimpleCollectionValueModel<String> subCVM1 = new SimpleCollectionValueModel<String>();
- SimpleCollectionValueModel<String> subCVM2 = new SimpleCollectionValueModel<String>();
- Collection<CollectionValueModel<String>> collection = new ArrayList<CollectionValueModel<String>>();
- collection.add(subCVM1);
- collection.add(subCVM2);
- Bag<String> synchBag = new CoordinatedBag<String>(new CompositeCollectionValueModel<CollectionValueModel<String>, String>(collection));
-
- assertEquals(0, synchBag.size());
-
- subCVM1.add("foo");
- subCVM1.add("bar");
- subCVM1.add("baz");
- assertEquals(3, synchBag.size());
- assertTrue(synchBag.contains("foo"));
-
- subCVM2.add("joo");
- subCVM2.add("jar");
- subCVM2.add("jaz");
- assertEquals(6, synchBag.size());
- assertTrue(synchBag.contains("foo"));
- assertTrue(synchBag.contains("jaz"));
-
- subCVM1.remove("baz");
- assertEquals(5, synchBag.size());
- assertFalse(synchBag.contains("baz"));
- }
-
- public void testDuplicateItem() {
- Bag<Member> synchBag = new CoordinatedBag<Member>(this.buildAllMembersComposite(this.neighborhoodHolder));
- this.populateNeighborhood(this.neighborhood);
- boolean exCaught = false;
- try {
- this.neighborhood.addFamily(this.neighborhood.familyNamed("Jetson"));
- } catch (IllegalStateException ex) {
- if (ex.getMessage().indexOf("duplicate component") != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- assertEquals(12, synchBag.size());
- }
-
- public void testHasListeners() {
- CompositeCollectionValueModel<Family, Member> compositeCVM = this.buildAllMembersComposite(this.neighborhoodHolder);
- CoordinatedBag<Member> synchBag = new CoordinatedBag<Member>(compositeCVM);
- this.populateNeighborhood(this.neighborhood);
- Family jetsons = this.neighborhood.familyNamed("Jetson");
-
- assertTrue(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
-
- compositeCVM.removeCollectionChangeListener(CollectionValueModel.VALUES, synchBag);
- assertFalse(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertFalse(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
-
- compositeCVM.addCollectionChangeListener(CollectionValueModel.VALUES, synchBag);
- assertTrue(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
- }
-
- private void populateNeighborhood(Neighborhood n) {
- Family family1 = n.addFamily("Flintstone");
- family1.addMember("Fred");
- family1.addMember("Wilma");
- family1.addMember("Pebbles");
- family1.addMember("Dino");
- Family family2 = n.addFamily("Rubble");
- family2.addMember("Barney");
- family2.addMember("Betty");
- family2.addMember("Bamm-Bamm");
- Family family3 = n.addFamily("Jetson");
- family3.addMember("George");
- family3.addMember("Jane");
- family3.addMember("Judy");
- family3.addMember("Elroy");
- family3.addMember("Astro");
- }
-
- private CollectionValueModel<Family> buildFamiliesAspectAdapter(PropertyValueModel<Neighborhood> communeHolder) {
- return new CollectionAspectAdapter<Neighborhood, Family>(communeHolder, Neighborhood.FAMILIES_COLLECTION) {
- @Override
- protected Iterator<Family> iterator_() {
- return this.subject.families();
- }
- };
- }
-
- CollectionValueModel<Member> buildMembersAdapter(Family family) {
- return new CollectionAspectAdapter<Family, Member>(Family.MEMBERS_COLLECTION, family) {
- @Override
- protected Iterator<Member> iterator_() {
- return this.subject.members();
- }
- };
- }
-
- private CompositeCollectionValueModel<Family, Member> buildAllMembersComposite(PropertyValueModel<Neighborhood> communeHolder) {
- // override #transform(Object)
- return new CompositeCollectionValueModel<Family, Member>(this.buildFamiliesAspectAdapter(communeHolder)) {
- @Override
- protected CollectionValueModel<Member> transform(Family family) {
- return CompositeCollectionValueModelTests.this.buildMembersAdapter(family);
- }
- };
- }
-
- private CollectionValueModel<Member> buildAllMembersComposite2(PropertyValueModel<Neighborhood> communeHolder) {
- // build a custom Transformer
- return new CompositeCollectionValueModel<Family, Member>(this.buildFamiliesAspectAdapter(communeHolder), this.buildTransformer());
- }
-
- private Transformer<Family, CollectionValueModel<Member>> buildTransformer() {
- return new Transformer<Family, CollectionValueModel<Member>>() {
- public CollectionValueModel<Member> transform(Family family) {
- return CompositeCollectionValueModelTests.this.buildMembersAdapter(family);
- }
- @Override
- public String toString() {
- return "Local Transformer";
- }
- };
- }
-
-
-// ********** inner classes **********
-
- /**
- * inner class
- */
- private class Neighborhood extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Collection<Family> families = new ArrayList<Family>();
- public static final String FAMILIES_COLLECTION = "families";
-
- public Neighborhood(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<Family> families() {
- return this.families.iterator();
- }
-
- public Family addFamily(String familyName) {
- return this.addFamily(new Family(familyName));
- }
-
- // backdoor to allow duplicates
- public Family addFamily(Family family) {
- this.addItemToCollection(family, this.families, FAMILIES_COLLECTION);
- return family;
- }
-
- public void removeFamily(Family family) {
- this.removeItemFromCollection(family, this.families, FAMILIES_COLLECTION);
- }
-
- public Family familyNamed(String familyName) {
- for (Family family : this.families) {
- if (family.getName().equals(familyName)) {
- return family;
- }
- }
- throw new IllegalArgumentException(familyName);
- }
-
- public Iterator<Member> allMembers() {
- return new CompositeIterator<Member>(this.membersIterators());
- }
-
- private Iterator<Iterator<Member>> membersIterators() {
- return new TransformationIterator<Family, Iterator<Member>>(this.families()) {
- @Override
- protected Iterator<Member> transform(Family family) {
- return family.members();
- }
- };
- }
-
- public Member memberNamed(String familyName, String memberName) {
- return this.familyNamed(familyName).memberNamed(memberName);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-
- /**
- * inner class
- */
- private class Family extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Collection<Member> members = new ArrayList<Member>();
- public static final String MEMBERS_COLLECTION = "members";
-
- public Family(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<Member> members() {
- return this.members.iterator();
- }
-
- public Member addMember(String memberName) {
- Member member = new Member(memberName);
- this.addItemToCollection(member, this.members, MEMBERS_COLLECTION);
- return member;
- }
-
- public void removeMember(Member member) {
- this.removeItemFromCollection(member, this.members, MEMBERS_COLLECTION);
- }
-
- public Member memberNamed(String memberName) {
- for (Member member : this.members) {
- if (member.getName().equals(memberName)) {
- return member;
- }
- }
- throw new IllegalArgumentException(memberName);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-
- /**
- * inner class
- */
- private class Member extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Member(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java
deleted file mode 100644
index 5ff07daaf0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java
+++ /dev/null
@@ -1,849 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CompositeListValueModelTests extends TestCase {
- private SimpleListValueModel<String> lvm0;
- private SimpleListValueModel<String> lvm1;
- private SimpleListValueModel<String> lvm2;
- private SimpleListValueModel<String> lvm3;
- private SimpleListValueModel<SimpleListValueModel<String>> uberLVM;
- private CompositeListValueModel<SimpleListValueModel<String>, String> compositeLVM;
-
- public CompositeListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.lvm0 = new SimpleListValueModel<String>();
- this.lvm0.add("aaa");
- this.lvm0.add("bbb");
- this.lvm0.add("ccc");
-
- this.lvm1 = new SimpleListValueModel<String>();
- this.lvm1.add("ddd");
- this.lvm1.add("eee");
-
- this.lvm2 = new SimpleListValueModel<String>();
- this.lvm2.add("fff");
-
- this.lvm3 = new SimpleListValueModel<String>();
- this.lvm3.add("ggg");
- this.lvm3.add("hhh");
- this.lvm3.add("iii");
- this.lvm3.add("jjj");
- this.lvm3.add("kkk");
-
- this.uberLVM = new SimpleListValueModel<SimpleListValueModel<String>>();
- this.uberLVM.add(this.lvm0);
- this.uberLVM.add(this.lvm1);
- this.uberLVM.add(this.lvm2);
- this.uberLVM.add(this.lvm3);
-
- this.compositeLVM = new CompositeListValueModel<SimpleListValueModel<String>, String>((ListValueModel<SimpleListValueModel<String>>) this.uberLVM);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetInt() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals("aaa", this.compositeLVM.get(0));
- assertEquals("aaa", coordList.get(0));
- assertEquals("bbb", this.compositeLVM.get(1));
- assertEquals("bbb", coordList.get(1));
- assertEquals("ccc", this.compositeLVM.get(2));
- assertEquals("ccc", coordList.get(2));
-
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- assertEquals("eee", this.compositeLVM.get(4));
- assertEquals("eee", coordList.get(4));
-
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
-
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testIterator() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals("aaa", this.compositeLVM.iterator().next());
- assertEquals("aaa", coordList.iterator().next());
- Iterator<String> stream1 = coordList.iterator();
- for (Iterator<String> stream2 = this.compositeLVM.iterator(); stream2.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- assertFalse(stream1.hasNext());
- }
-
- public void testSize() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals(11, this.compositeLVM.size());
- assertEquals(11, coordList.size());
- }
-
- public void testToArray() {
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- }
-
- public void testHasListeners() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- assertTrue(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.compositeLVM.removeListChangeListener(ListValueModel.LIST_VALUES, coordList);
- assertFalse(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, coordList);
- assertTrue(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testAddSource_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(0, lvm);
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddSource_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(2, lvm);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddSource_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(lvm);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testAddSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvmA = new SimpleListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- SimpleListValueModel<String> lvmB = new SimpleListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- Collection<SimpleListValueModel<String>> c = new ArrayList<SimpleListValueModel<String>>();
- c.add(lvmA);
- c.add(lvmB);
- this.uberLVM.addAll(2, c);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "ppp", "qqq", "rrr", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(12));
- assertEquals("ggg", coordList.get(12));
- }
-
- public void testRemoveSource_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(0);
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testRemoveSource_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveSource_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testRemoveSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(2, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("eee", this.compositeLVM.get(4));
- assertEquals("eee", coordList.get(4));
- }
-
- public void testReplaceSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvmA = new SimpleListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- SimpleListValueModel<String> lvmB = new SimpleListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- List<SimpleListValueModel<String>> list = new ArrayList<SimpleListValueModel<String>>();
- list.add(lvmA);
- list.add(lvmB);
- this.uberLVM.set(2, list);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "ppp", "qqq", "rrr" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("qqq", this.compositeLVM.get(9));
- assertEquals("qqq", coordList.get(9));
- }
-
- public void testMoveSources_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(0, 2, 2);
-
- Object[] expected = new Object[] { "fff", "ggg", "hhh", "iii", "jjj", "kkk", "aaa", "bbb", "ccc", "ddd", "eee" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(1));
- assertEquals("ggg", coordList.get(1));
- }
-
- public void testMoveSources_Middle() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(1, 3, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm", "ddd", "eee", "fff", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testMoveSources_End() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(3, 0, 3);
-
- Object[] expected = new Object[] { "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm", "nnn", "ooo", "ppp", "qqq", "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(0));
- assertEquals("ggg", coordList.get(0));
- }
-
- public void testMoveSource() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(3, 1);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "ddd", "eee", "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(14));
- assertEquals("ooo", coordList.get(14));
- }
-
- public void testClearSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.clear();
-
- Object[] expected = new Object[0];
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- }
-
- public void testChangeSources() {
- List<SimpleListValueModel<String>> newList = new ArrayList<SimpleListValueModel<String>>();
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- newList.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.setList(newList);
-
- Object[] expected = new Object[] { "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(3));
- assertEquals("ooo", coordList.get(3));
- }
-
- public void testAddItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.add(0, "xxx");
-
- Object[] expected = new Object[] { "xxx", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testAddItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.add(1, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testAddItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.add(5, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testAddItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.addAll(0, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.addAll(1, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "yyy", "zzz", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.addAll(5, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testRemoveItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.remove(0);
-
- Object[] expected = new Object[] { "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.remove(0);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(4);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testRemoveItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.remove(0, 3);
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testRemoveItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(1, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("kkk", this.compositeLVM.get(7));
- assertEquals("kkk", coordList.get(7));
- }
-
- public void testRemoveItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(3, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.set(0, "xxx");
-
- Object[] expected = new Object[] { "xxx", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.set(0, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(4, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.set(0, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(1, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "xxx", "yyy", "zzz", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("kkk", this.compositeLVM.get(10));
- assertEquals("kkk", coordList.get(10));
- }
-
- public void testReplaceItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(3, Arrays.asList(new String[] { "xxx", "yyy" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "xxx", "yyy" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.move(2, 0);
-
- Object[] expected = new Object[] { "bbb", "ccc", "aaa", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.move(0, 1);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "eee", "ddd", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.move(0, 4);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "kkk", "ggg", "hhh", "iii", "jjj" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testMoveItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.move(1, 0, 2);
-
- Object[] expected = new Object[] { "ccc", "aaa", "bbb", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.add("eee.1");
- this.lvm1.add("eee.2");
- this.lvm1.add("eee.3");
- this.lvm1.move(1, 2, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee.1", "eee.2", "eee.3", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testMoveItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.move(0, 2, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "iii", "jjj", "kkk", "ggg", "hhh" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testClearItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.clear();
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testClearItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.clear();
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(4));
- assertEquals("ggg", coordList.get(4));
- }
-
- public void testClearItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.clear();
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.setList(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testChangeItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.setList(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "xxx", "yyy", "zzz", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testChangeItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.setList(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java
deleted file mode 100644
index 5bee337438..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * Helper class that keeps an internal collection in synch with the
- * collection held by a collection value model.
- */
-class CoordinatedBag<E> implements Bag<E>, CollectionChangeListener {
-
- private Bag<E> bag = new HashBag<E>();
-
- CoordinatedBag(CollectionValueModel<E> cvm) {
- cvm.addCollectionChangeListener(CollectionValueModel.VALUES, this);
- }
-
-
- // ********** Collection implementation **********
-
- public boolean add(E o) {
- return this.bag.add(o);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.bag.addAll(c);
- }
-
- public void clear() {
- this.bag.clear();
- }
-
- public boolean contains(Object o) {
- return this.bag.contains(o);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.bag.containsAll(c);
- }
-
- public boolean isEmpty() {
- return this.bag.isEmpty();
- }
-
- public Iterator<E> iterator() {
- return this.bag.iterator();
- }
-
- public boolean remove(Object o) {
- return this.bag.remove(o);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.bag.removeAll(c);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.bag.retainAll(c);
- }
-
- public int size() {
- return this.bag.size();
- }
-
- public Object[] toArray() {
- return this.bag.toArray();
- }
-
- public <T> T[] toArray(T[] a) {
- return this.bag.toArray(a);
- }
-
-
- // ********** Bag implementation **********
-
- public int count(Object o) {
- return this.bag.count(o);
- }
-
- public boolean add(E o, int count) {
- return this.bag.add(o, count);
- }
-
- public boolean remove(Object o, int count) {
- return this.bag.remove(o, count);
- }
-
- public Iterator<E> uniqueIterator() {
- return this.bag.uniqueIterator();
- }
-
- public Iterator<Bag.Entry<E>> entries() {
- return this.bag.entries();
- }
-
- // ********** CollectionChangeListener implementation **********
-
- public void itemsAdded(CollectionChangeEvent e) {
- for (@SuppressWarnings("unchecked") Iterator<E> stream = (Iterator<E>) e.items(); stream.hasNext(); ) {
- this.bag.add(stream.next());
- }
- }
-
- public void itemsRemoved(CollectionChangeEvent e) {
- for (@SuppressWarnings("unchecked") Iterator<E> stream = (Iterator<E>) e.items(); stream.hasNext(); ) {
- this.bag.remove(stream.next());
- }
- }
-
- public void collectionCleared(CollectionChangeEvent e) {
- this.bag.clear();
- }
-
- @SuppressWarnings("unchecked")
- public void collectionChanged(CollectionChangeEvent e) {
- this.bag.clear();
- CollectionTools.addAll(this.bag, ((CollectionValueModel<E>) e.getSource()).iterator());
- }
-
-
- // ********** standard methods **********
-
- @Override
- public boolean equals(Object o) {
- return this.bag.equals(o);
- }
-
- @Override
- public int hashCode() {
- return this.bag.hashCode();
- }
-
- @Override
- public String toString() {
- return this.bag.toString();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java
deleted file mode 100644
index 7bf7b88c6f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Helper class that keeps an internal list in synch with the
- * list held by a list value model.
- */
-public class CoordinatedList<E> implements List<E>, ListChangeListener, ListDataListener {
- private List<E> list = new ArrayList<E>();
-
- public CoordinatedList(ListValueModel<E> listValueModel) {
- listValueModel.addListChangeListener(ListValueModel.LIST_VALUES, this);
- for (Iterator<E> stream = listValueModel.iterator(); stream.hasNext(); ) {
- this.add(stream.next());
- }
- }
-
- public CoordinatedList(ListModel listModel) {
- listModel.addListDataListener(this);
- for (int i = 0; i < listModel.getSize(); i++) {
- this.add(i, this.getElementAt(listModel, i));
- }
- }
-
-
- // ********** List implementation **********
-
- public void add(int index, E element) {
- this.list.add(index, element);
- }
-
- public boolean add(E o) {
- return this.list.add(o);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.list.addAll(c);
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return this.list.addAll(index, c);
- }
-
- public void clear() {
- this.list.clear();
- }
-
- public boolean contains(Object o) {
- return this.list.contains(o);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.list.containsAll(c);
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public int indexOf(Object o) {
- return this.list.indexOf(o);
- }
-
- public boolean isEmpty() {
- return this.list.isEmpty();
- }
-
- public Iterator<E> iterator() {
- return this.list.iterator();
- }
-
- public int lastIndexOf(Object o) {
- return this.list.lastIndexOf(o);
- }
-
- public ListIterator<E> listIterator() {
- return this.list.listIterator();
- }
-
- public ListIterator<E> listIterator(int index) {
- return this.list.listIterator(index);
- }
-
- public E remove(int index) {
- return this.list.remove(index);
- }
-
- public boolean remove(Object o) {
- return this.list.remove(o);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.list.removeAll(c);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.list.retainAll(c);
- }
-
- public E set(int index, E element) {
- return this.list.set(index, element);
- }
-
- public int size() {
- return this.list.size();
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- return this.list.subList(fromIndex, toIndex);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
- public <T> T[] toArray(T[] a) {
- return this.list.toArray(a);
- }
-
-
- // ********** ListChangeListener implementation **********
-
- public void itemsAdded(ListChangeEvent e) {
- int i = e.getIndex();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.list.add(i++, stream.next());
- }
- }
-
- public void itemsRemoved(ListChangeEvent e) {
- int i = e.getIndex();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- stream.next();
- this.list.remove(i);
- }
- }
-
- public void itemsReplaced(ListChangeEvent e) {
- int i = e.getIndex();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.list.set(i++, stream.next());
- }
- }
-
- public void itemsMoved(ListChangeEvent e) {
- CollectionTools.move(this.list, e.getTargetIndex(), e.getSourceIndex(), e.getMoveLength());
- }
-
- public void listCleared(ListChangeEvent e) {
- this.list.clear();
- }
-
- public void listChanged(ListChangeEvent e) {
- this.list.clear();
- CollectionTools.addAll(this.list, this.getSource(e).iterator());
- }
-
-
- // ********** ListDataListener implementation **********
-
- public void contentsChanged(ListDataEvent e) {
- this.list.clear();
- ListModel lm = (ListModel) e.getSource();
- int size = lm.getSize();
- for (int i = 0; i < size; i++) {
- this.list.add(i, this.getElementAt(lm, i));
- }
- }
-
- public void intervalAdded(ListDataEvent e) {
- ListModel lm = (ListModel) e.getSource();
- int start = Math.min(e.getIndex0(), e.getIndex1());
- int end = Math.max(e.getIndex0(), e.getIndex1());
- for (int i = start; i <= end; i++) {
- this.list.add(i, this.getElementAt(lm, i));
- }
- }
-
- public void intervalRemoved(ListDataEvent e) {
- int start = Math.min(e.getIndex0(), e.getIndex1());
- int end = Math.max(e.getIndex0(), e.getIndex1());
- int length = end - start + 1;
- for (int i = 1; i <= length; i++) {
- this.list.remove(start);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public boolean equals(Object o) {
- return this.list.equals(o);
- }
-
- @Override
- public int hashCode() {
- return this.list.hashCode();
- }
-
- @Override
- public String toString() {
- return this.list.toString();
- }
-
-
- // ********** internal methods **********
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private E getElementAt(ListModel listModel, int index) {
- return (E) listModel.getElementAt(index);
- }
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private Iterator<E> items(ListChangeEvent event) {
- return (Iterator<E>) event.items();
- }
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private ListValueModel<E> getSource(ListChangeEvent event) {
- return (ListValueModel<E>) event.getSource();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
deleted file mode 100644
index 9ecba890a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ExtendedListValueModelWrapperTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> extendedListHolder;
- ListChangeEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
- public ExtendedListValueModelWrapperTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- this.extendedListHolder = this.buildExtendedListHolder(this.listHolder);
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("A");
- result.add("B");
- result.add("C");
- result.add("D");
- return result;
- }
-
- private List<String> buildExtendedList() {
- List<String> extendedList = new ArrayList<String>();
- extendedList.addAll(this.buildPrefix());
- extendedList.addAll(this.buildList());
- extendedList.addAll(this.buildSuffix());
- return extendedList;
- }
-
- private List<String> buildPrefix() {
- List<String> prefix = new ArrayList<String>();
- prefix.add("x");
- prefix.add("y");
- prefix.add("z");
- return prefix;
- }
-
- private List<String> buildSuffix() {
- List<String> suffix = new ArrayList<String>();
- suffix.add("i");
- suffix.add("j");
- return suffix;
- }
-
- private ListValueModel<String> buildExtendedListHolder(ListValueModel<String> lvm) {
- return new ExtendedListValueModelWrapper<String>(this.buildPrefix(), lvm, this.buildSuffix());
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildExtendedList(), CollectionTools.list(this.extendedListHolder.iterator()));
- }
-
- public void testSize() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildExtendedList().size(), CollectionTools.size(this.extendedListHolder.iterator()));
- assertEquals(this.buildExtendedList().size(), this.extendedListHolder.size());
- }
-
- private boolean extendedListContains(Object item) {
- return CollectionTools.contains(this.extendedListHolder.iterator(), item);
- }
-
- private boolean extendedListContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.extendedListHolder.iterator(), items);
- }
-
- private boolean extendedListContainsAny(Collection<String> items) {
- List<String> extendedList = CollectionTools.list(this.extendedListHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (extendedList.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- private boolean listContains(Object item) {
- return CollectionTools.contains(this.listHolder.iterator(), item);
- }
-
- private boolean listContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.listHolder.iterator(), items);
- }
-
-// private boolean listContainsAny(Collection<String> items) {
-// List<String> extendedList = CollectionTools.list(this.listHolder.iterator());
-// for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
-// if (extendedList.contains(stream.next())) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
- public void testAdd1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContains("E"));
- this.listHolder.add(4, "E");
- assertTrue(this.extendedListContains("E"));
- assertTrue(this.listContains("E"));
- }
-
- public void testAdd2() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContains(null));
- this.listHolder.add(4, null);
- assertTrue(this.extendedListContains(null));
- assertTrue(this.listContains(null));
- }
-
- private List<String> buildAddList() {
- List<String> addList = new ArrayList<String>();
- addList.add("E");
- addList.add("F");
- return addList;
- }
-
- public void testAddAll1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContainsAny(this.buildAddList()));
- this.listHolder.addAll(4, this.buildAddList());
- assertTrue(this.extendedListContainsAll(this.buildAddList()));
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testRemove1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertTrue(this.extendedListContains("B"));
- this.listHolder.remove(this.buildList().indexOf("B"));
- assertFalse(this.extendedListContains("B"));
- assertFalse(this.listContains("B"));
- }
-
- public void testListChangeGeneric() {
- this.extendedListHolder.addListChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChangeNamed() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(4, "E");
- this.verifyEvent(ADD, 7, "E");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(5, null);
- this.verifyEvent(ADD, 8, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(5);
- this.verifyEvent(REMOVE, 8, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(4);
- this.verifyEvent(REMOVE, 7, "E");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildList(), CollectionTools.list(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "AA");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "A"));
- assertTrue(CollectionTools.contains(this.event.items(), "AA"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = ADD;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REMOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REPLACE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = MOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CLEAR;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CHANGE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String type) {
- assertEquals(type, this.eventType);
- assertEquals(this.extendedListHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.getListName());
- }
-
- private void verifyEvent(String type, int index, Object item) {
- this.verifyEvent(type);
- assertEquals(index, this.event.getIndex());
- assertEquals(item, this.event.items().next());
- }
-
- public void testHasListeners() {
- /*
- * adding listeners to the extended list will cause listeners
- * to be added to the wrapped list;
- * likewise, removing listeners from the extended list will
- * cause listeners to be removed from the wrapped list
- */
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener = this.buildListener();
-
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.addListChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeListChangeListener(listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
deleted file mode 100644
index 69f6e797fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class FilteringCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> collectionHolder;
- CollectionChangeEvent addEvent;
- CollectionChangeEvent removeEvent;
- CollectionChangeEvent collectionClearedEvent;
- CollectionChangeEvent collectionChangedEvent;
-
- private CollectionValueModel<String> filteredCollectionHolder;
- CollectionChangeEvent filteredAddEvent;
- CollectionChangeEvent filteredRemoveEvent;
- CollectionChangeEvent filteredCollectionClearedEvent;
- CollectionChangeEvent filteredCollectionChangedEvent;
-
- public FilteringCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new SimpleCollectionValueModel<String>(buildCollection());
- this.filteredCollectionHolder = new FilteringCollectionValueModel<String>(this.collectionHolder, this.buildFilter());
- }
-
- private Collection<String> buildCollection() {
- Collection<String> collection = new Vector<String>();
- collection.add("foo");
- return collection;
- }
-
- private Filter<String> buildFilter() {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith("b");
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- // add a listener to "activate" the wrapper
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.add("bar");
- Iterator<String> collectionHolderValue = this.collectionHolder.iterator();
- assertEquals("foo", collectionHolderValue.next());
- assertEquals("bar", collectionHolderValue.next());
- assertTrue(this.filteredCollectionHolder.iterator().hasNext());
- assertEquals("bar", this.filteredCollectionHolder.iterator().next());
-
- this.collectionHolder.remove("bar");
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.remove("foo");
- assertFalse(this.collectionHolder.iterator().hasNext());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.add("foo");
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
- }
-
- public void testSetValue() {
- // add a listener to "activate" the wrapper
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- Collection<String> newCollection = new Vector<String>();
- newCollection.add("fox");
- newCollection.add("baz");
-
- this.collectionHolder.setCollection(newCollection);
-
- Iterator<String> collectionValues = this.collectionHolder.iterator();
- assertEquals("fox", collectionValues.next());
- assertEquals("baz", collectionValues.next());
- Iterator<String> filteredCollectionValues = this.filteredCollectionHolder.iterator();
- assertEquals("baz", filteredCollectionValues.next());
- assertFalse(filteredCollectionValues.hasNext());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- CollectionChangeListener listener = this.buildFilteredListener();
- this.filteredCollectionHolder.addCollectionChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeCollectionChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testCollectionChange1() {
- this.collectionHolder.addCollectionChangeListener(this.buildListener());
- this.filteredCollectionHolder.addCollectionChangeListener(this.buildFilteredListener());
- this.verifyCollectionChanges();
- }
-
- public void testCollectionChange2() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildListener());
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
- this.verifyCollectionChanges();
- }
-
- private void clearEvents() {
- this.addEvent = null;
- this.removeEvent = null;
- this.collectionClearedEvent = null;
- this.collectionChangedEvent = null;
- this.filteredAddEvent = null;
- this.filteredRemoveEvent = null;
- this.filteredCollectionClearedEvent = null;
- this.filteredCollectionChangedEvent = null;
- }
-
- private void verifyCollectionChanges() {
- clearEvents();
- this.collectionHolder.add("bar");
- Collection<String> tempCollection = new Vector<String>();
- tempCollection.add("bar");
- this.verifyEvent(this.addEvent, this.collectionHolder, tempCollection);
- this.verifyEvent(this.filteredAddEvent, this.filteredCollectionHolder, tempCollection);
-
- clearEvents();
- this.collectionHolder.remove("foo");
- tempCollection.remove("bar");
- tempCollection.add("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, tempCollection);
- assertNull(this.filteredRemoveEvent);
-
-
- clearEvents();
- this.collectionHolder.remove("bar");
- tempCollection.add("bar");
- tempCollection.remove("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, tempCollection);
- this.verifyEvent(this.filteredRemoveEvent, this.filteredCollectionHolder, tempCollection);
-
-
- clearEvents();
- this.collectionHolder.add("foo");
- tempCollection.remove("bar");
- tempCollection.add("foo");
- this.verifyEvent(this.addEvent, this.collectionHolder, tempCollection);
- assertNull(this.filteredAddEvent);
-
-
- clearEvents();
- Collection<String> newCollection = new Vector<String>();
- newCollection.add("fox");
- newCollection.add("baz");
-
- this.collectionHolder.setCollection(newCollection);
-
- this.verifyEvent(this.collectionChangedEvent, this.collectionHolder, new Vector<String>());
-
- tempCollection.remove("foo");
- tempCollection.add("baz");
- this.verifyEvent(this.filteredCollectionChangedEvent, this.filteredCollectionHolder, new Vector<String>());
-
- }
-
- private CollectionChangeListener buildListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.addEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.removeEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionChangedEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildFilteredListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredAddEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredRemoveEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionChangedEvent = e;
- }
- };
- }
-
- private void verifyEvent(CollectionChangeEvent event, Object source, Object items) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(items, CollectionTools.vector(event.items()));
- }
-
- public void testRemoveFilteredItem() {
- // build collection with TestItems
- SimpleCollectionValueModel<TestItem> tiHolder = new SimpleCollectionValueModel<TestItem>(this.buildCollection2());
- CollectionValueModel<TestItem> filteredTIHolder = new FilteringCollectionValueModel<TestItem>(tiHolder, this.buildFilter2());
- // add a listener to "activate" the wrapper
- filteredTIHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- assertEquals(0, filteredTIHolder.size());
-
- tiHolder.add(new TestItem("bar"));
- assertEquals(1, filteredTIHolder.size());
-
- TestItem baz = new TestItem("baz");
- tiHolder.add(baz);
- assertEquals(2, filteredTIHolder.size());
- // before removing it, change the item so that it is filtered
- baz.name = "jaz";
- tiHolder.remove(baz);
- // this would fail because the item was not removed from
- // the filtered collection cache... but we've fixed it now
- assertEquals(1, filteredTIHolder.size());
- }
-
- private Collection<TestItem> buildCollection2() {
- Collection<TestItem> collection = new Vector<TestItem>();
- collection.add(new TestItem("foo"));
- return collection;
- }
-
- private Filter<TestItem> buildFilter2() {
- return new Filter<TestItem>() {
- public boolean accept(TestItem ti) {
- return ti.name.startsWith("b");
- }
- };
- }
-
-
- // ********** TestItem inner class **********
-
- private class TestItem {
- String name;
- TestItem(String name) {
- super();
- this.name = name;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
deleted file mode 100644
index 81912fd3f2..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.FilteringWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class FilteringPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> filteredObjectHolder;
- PropertyChangeEvent filteredEvent;
-
- public FilteringPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.filteredObjectHolder = new FilteringWritablePropertyValueModel<String>(this.objectHolder, this.buildFilter());
- }
-
- private BidiFilter<String> buildFilter() {
- return new BidiFilter<String>() {
- public boolean accept(String s) {
- return (s != null) && s.startsWith("b");
- }
- public boolean reverseAccept(String s) {
- return (s != null) && s.startsWith("b");
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- assertNull(this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertNotNull(this.filteredObjectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertNotNull(this.filteredObjectHolder.getValue());
- assertEquals("baz", this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertNull(this.filteredObjectHolder.getValue());
- }
-
- public void testSetValue() {
- this.filteredObjectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.filteredObjectHolder.setValue("foo");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.filteredObjectHolder.setValue(null);
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.filteredObjectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertEquals("baz", this.filteredObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- PropertyChangeListener listener = this.buildFilteredListener();
- this.filteredObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removePropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.filteredObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.filteredObjectHolder.addPropertyChangeListener(this.buildFilteredListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.filteredObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildFilteredListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, "foo", "bar");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, null, "bar");
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(this.event, this.objectHolder, "bar", "baz");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, "bar", "baz");
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("foo");
- this.verifyEvent(this.event, this.objectHolder, "baz", "foo");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, "baz", null);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("fop");
- this.verifyEvent(this.event, this.objectHolder, "foo", "fop");
- assertNull(this.filteredEvent);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, "fop", null);
- assertNull(this.filteredEvent);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, null, "bar");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, null, "bar");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildFilteredListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.filteredEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
deleted file mode 100644
index 347bbed778..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemCollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemCollectionListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemCollectionListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("foo");
- this.bar = new Junk("bar");
- this.baz = new Junk("baz");
- this.joo = new Junk("joo");
- this.jar = new Junk("jar");
- this.jaz = new Junk("jaz");
-
- this.tom = new Junk("tom");
- this.dick = new Junk("dick");
- this.harry = new Junk("harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(collectionHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_COLLECTION));
-
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertTrue(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.removeStuff("bar");
- this.bar.addStuff("zzz");
- this.bar.addStuff("bar");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.removeStuff("zzz");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable {
- private Collection<String> stuff;
- public static final String STUFF_COLLECTION = "stuff";
-
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public String displayString() {
- return toString();
- }
-
- public Icon icon() {
- return null;
- }
-
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
deleted file mode 100644
index bfc8169e55..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemListListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemListListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemListListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("foo");
- this.bar = new Junk("bar");
- this.baz = new Junk("baz");
- this.joo = new Junk("joo");
- this.jar = new Junk("jar");
- this.jaz = new Junk("jaz");
-
- this.tom = new Junk("tom");
- this.dick = new Junk("dick");
- this.harry = new Junk("harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(collectionHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
-
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertTrue(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.removeStuff("bar");
- this.bar.addStuff("zzz");
- this.bar.addStuff("bar");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.removeStuff("zzz");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable {
- private List<String> stuff;
- public static final String STUFF_LIST = "stuff";
-
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
- public void addStuff(String stuffItem) {
- this.stuff.add(stuffItem);
- fireItemAdded(STUFF_LIST, this.stuff.indexOf(stuffItem), stuffItem);
- }
-
- public void removeStuff(String stuffItem) {
- int index = this.stuff.indexOf(stuffItem);
- this.stuff.remove(stuffItem);
- fireItemRemoved(STUFF_LIST, index, stuffItem);
- }
-
- public String displayString() {
- return toString();
- }
-
- public Icon icon() {
- return null;
- }
-
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
deleted file mode 100644
index 3860703216..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemPropertyListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemPropertyListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("this.foo");
- this.bar = new Junk("this.bar");
- this.baz = new Junk("this.baz");
- this.joo = new Junk("this.joo");
- this.jar = new Junk("this.jar");
- this.jaz = new Junk("this.jaz");
-
- this.tom = new Junk("this.tom");
- this.dick = new Junk("this.dick");
- this.harry = new Junk("this.harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(collectionHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.setCollection(this.buildCollection());
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(listHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- // test concurrent modification exception
- listHolder.setList(this.buildList());
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<Junk> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<Junk>() {
- public int compare(Junk o1, Junk o2) {
- return o2.compareTo(o1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<Junk> comparator) {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(collectionHolder, comparator), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.setCollection(this.buildCollection());
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<Junk> comparator) {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder, comparator), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.add(0, this.tom);
- listHolder.add(0, this.dick);
- listHolder.add(0, this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.setList(this.buildList());
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void compareSort(ListValueModel<Junk> listValueModel, List<Junk> list, Comparator<Junk> comparator) {
- SortedSet<Junk> ss = new TreeSet<Junk>(comparator);
- for (int i = 0; i < listValueModel.size(); i++) {
- ss.add(listValueModel.get(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<Junk> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
-
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertTrue(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertTrue(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertTrue(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemPropertyListValueModelAdapter<Junk>(listHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.setName("zzz");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.setName("this.bar");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public String displayString() {
- return this.name;
- }
- public Icon icon() {
- return null;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
deleted file mode 100644
index 66146ded02..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemStateListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemStateListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemStateListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("this.foo");
- this.bar = new Junk("this.bar");
- this.baz = new Junk("this.baz");
- this.joo = new Junk("this.joo");
- this.jar = new Junk("this.jar");
- this.jaz = new Junk("this.jaz");
-
- this.tom = new Junk("this.tom");
- this.dick = new Junk("this.dick");
- this.harry = new Junk("this.harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(collectionHolder);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(listHolder);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<Junk> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<Junk>() {
- public int compare(Junk o1, Junk o2) {
- return o2.compareTo(o1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<Junk> comparator) {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(collectionHolder, comparator));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<Junk> comparator) {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder, comparator));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.add(0, this.tom);
- listHolder.add(0, this.dick);
- listHolder.add(0, this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void compareSort(ListValueModel<Junk> listValueModel, List<Junk> list, Comparator<Junk> comparator) {
- SortedSet<Junk> ss = new TreeSet<Junk>(comparator);
- for (int i = 0; i < listValueModel.size(); i++) {
- ss.add(listValueModel.get(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<Junk> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
-
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder));
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyStateChangeListeners());
- assertTrue(this.foo.hasAnyStateChangeListeners());
- assertTrue(this.jaz.hasAnyStateChangeListeners());
- assertTrue(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemStateListValueModelAdapter<Junk>(listHolder));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.setName("zzz");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.setName("this.bar");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
- // ********** Junk class **********
- private class Junk extends AbstractModel implements Comparable<Junk> {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public void setName(String name) {
- this.name = name;
- this.fireStateChanged();
- }
- public int compareTo(Junk j) {
- return this.name.compareTo(j.name);
- }
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java
deleted file mode 100644
index 1939e03021..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.tests.internal.model.value.prefs.JptUtilityModelValuePrefsTests;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.JptUtilityModelValueSwingTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValueTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValueTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityModelValuePrefsTests.suite());
- suite.addTest(JptUtilityModelValueSwingTests.suite());
-
- suite.addTestSuite(BufferedWritablePropertyValueModelTests.class);
- suite.addTestSuite(CachingTransformationPropertyValueModelTests.class);
- suite.addTestSuite(CachingTransformationWritablePropertyValueModelTests.class);
- suite.addTestSuite(CollectionAspectAdapterTests.class);
- suite.addTestSuite(CollectionListValueModelAdapterTests.class);
- suite.addTestSuite(CollectionPropertyValueModelAdapterTests.class);
- suite.addTestSuite(CompositeCollectionValueModelTests.class);
- suite.addTestSuite(CompositeListValueModelTests.class);
- suite.addTestSuite(ExtendedListValueModelWrapperTests.class);
- suite.addTestSuite(FilteringCollectionValueModelTests.class);
- suite.addTestSuite(FilteringPropertyValueModelTests.class);
- suite.addTestSuite(ItemCollectionListValueModelAdapterTests.class);
- suite.addTestSuite(ItemListListValueModelAdapterTests.class);
- suite.addTestSuite(ItemPropertyListValueModelAdapterTests.class);
- suite.addTestSuite(ItemStateListValueModelAdapterTests.class);
- suite.addTestSuite(ListAspectAdapterTests.class);
- suite.addTestSuite(ListCollectionValueModelAdapterTests.class);
- suite.addTestSuite(ListCuratorTests.class);
- suite.addTestSuite(NullCollectionValueModelTests.class);
- suite.addTestSuite(NullListValueModelTests.class);
- suite.addTestSuite(NullPropertyValueModelTests.class);
- suite.addTestSuite(PropertyAspectAdapterTests.class);
- suite.addTestSuite(PropertyCollectionValueModelAdapterTests.class);
- suite.addTestSuite(PropertyListValueModelAdapterTests.class);
- suite.addTestSuite(StaticCollectionValueModelTests.class);
- suite.addTestSuite(StaticListValueModelTests.class);
- suite.addTestSuite(SimpleCollectionValueModelTests.class);
- suite.addTestSuite(SimpleListValueModelTests.class);
- suite.addTestSuite(SimplePropertyValueModelTests.class);
- suite.addTestSuite(SortedListValueModelAdapterTests.class);
- suite.addTestSuite(StaticValueModelTests.class);
- suite.addTestSuite(TransformationListValueModelAdapterTests.class);
- suite.addTestSuite(TransformationListValueModelAdapterTests.TransformerTests.class);
- suite.addTestSuite(TransformationPropertyValueModelTests.class);
- suite.addTestSuite(TreeAspectAdapterTests.class);
- suite.addTestSuite(ValueCollectionAdapterTests.class);
- suite.addTestSuite(ValueListAdapterTests.class);
- suite.addTestSuite(ValuePropertyAdapterTests.class);
- suite.addTestSuite(ValueStateAdapterTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValueTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java
deleted file mode 100644
index fe825baa96..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ListAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalListAspectAdapter aa1;
- private ListChangeEvent event1;
- private ListChangeListener listener1;
-
- private TestSubject subject2;
-
- public ListAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- this.subject1.addNames(this.subject1Names());
- this.subject1.addDescriptions(this.subject1Descriptions());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject();
- this.subject2.addNames(this.subject2Names());
- this.subject2.addDescriptions(this.subject2Descriptions());
- }
-
- private List<String> subject1Names() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- result.add("bam");
- return result;
- }
-
- private List<String> subject1Descriptions() {
- List<String> result = new ArrayList<String>();
- result.add("this.subject1 description1");
- result.add("this.subject1 description2");
- return result;
- }
-
- private List<String> subject2Names() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- result.add("jam");
- return result;
- }
-
- private List<String> subject2Descriptions() {
- List<String> result = new ArrayList<String>();
- result.add("this.subject2 description1");
- result.add("this.subject2 description2");
- return result;
- }
-
- private LocalListAspectAdapter buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new LocalListAspectAdapter(subjectHolder);
- }
-
- private ListChangeListener buildValueChangeListener1() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listCleared(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject2Names(), CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- assertFalse(this.aa1.iterator().hasNext());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addName("jam");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject1Names().size(), this.event1.getIndex());
- assertEquals("jam", this.event1.items().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.add("jam");
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- this.aa1.add(2, "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(2, this.event1.getIndex());
- assertEquals("jaz", this.event1.items().next());
- namesPlus.add(2, "jaz");
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testDefaultAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- List<String> items = new ArrayList<String>();
- items.add("joo");
- items.add("jar");
- items.add("jaz");
- items.add("jam");
-
- this.event1 = null;
- this.aa1.addAll(2, items);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(5, this.event1.getIndex()); // only the last "add" event will still be there
- assertEquals("jam", this.event1.items().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.addAll(2, items);
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- String removedName = this.subject1.removeName(0); // should be "foo"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, this.event1.getIndex());
- assertEquals(removedName, this.event1.items().next());
- List<String> namesMinus = this.subject1Names();
- namesMinus.remove(0);
- assertEquals(namesMinus, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- Object removedItem = this.aa1.remove(0);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, this.event1.getIndex());
- assertEquals(removedItem, this.event1.items().next());
- namesMinus.remove(0);
- assertEquals(namesMinus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testDefaultLength() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- List<String> items = new ArrayList<String>();
- items.add("bar");
- items.add("baz");
-
- this.event1 = null;
- this.aa1.remove(1, 2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(1, this.event1.getIndex()); // only the last "remove" event will still be there
- assertEquals("baz", this.event1.items().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.remove(1);
- namesPlus.remove(1);
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testReplace() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- String replacedName = this.subject1.setName(0, "jelly"); // should be "foo"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, this.event1.getIndex());
- assertEquals("jelly", this.event1.items().next());
- assertEquals(replacedName, this.event1.replacedItems().next());
- List<String> namesChanged = this.subject1Names();
- namesChanged.set(0, "jelly");
- assertEquals(namesChanged, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- replacedName = this.subject1.setName(1, "roll"); // should be "bar"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(1, this.event1.getIndex());
- assertEquals("roll", this.event1.items().next());
- assertEquals(replacedName, this.event1.replacedItems().next());
- namesChanged = this.subject1Names();
- namesChanged.set(0, "jelly");
- namesChanged.set(1, "roll");
- assertEquals(namesChanged, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testListChange() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addTwoNames("jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- List<String> namesPlus2 = this.subject1Names();
- namesPlus2.add(0, "jaz");
- namesPlus2.add(0, "jam");
- assertEquals(namesPlus2, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.subject1.names()));
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testGet() {
- assertEquals(this.subject1Names().get(0), this.subject1.getName(0));
- assertEquals(this.subject1Names().get(0), this.aa1.get(0));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.names()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.aa1.listIterator()));
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addListChangeListener(listener2);
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeListChangeListener(listener2);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private List<String> names;
- public static final String NAMES_LIST = "names";
- private List<String> descriptions;
- public static final String DESCRIPTIONS_LIST = "descriptions";
-
- public TestSubject() {
- this.names = new ArrayList<String>();
- this.descriptions = new ArrayList<String>();
- }
- public ListIterator<String> names() {
- return new ReadOnlyListIterator<String>(this.names);
- }
- public String getName(int index) {
- return this.names.get(index);
- }
- public void addName(int index, String name) {
- this.names.add(index, name);
- this.fireItemAdded(NAMES_LIST, index, name);
- }
- public void addName(String name) {
- this.addName(this.names.size(), name);
- }
- public void addNames(ListIterator<String> newNames) {
- while (newNames.hasNext()) {
- this.addName(newNames.next());
- }
- }
- public void addNames(List<String> newNames) {
- this.addNames(newNames.listIterator());
- }
- public void addTwoNames(String name1, String name2) {
- this.names.add(0, name2);
- this.names.add(0, name1);
- this.fireListChanged(NAMES_LIST);
- }
- public String removeName(int index) {
- String removedName = this.names.remove(index);
- this.fireItemRemoved(NAMES_LIST, index, removedName);
- return removedName;
- }
- public String setName(int index, String name) {
- String replacedName = this.names.set(index, name);
- this.fireItemReplaced(NAMES_LIST, index, name, replacedName);
- return replacedName;
- }
- public ListIterator<String> descriptions() {
- return new ReadOnlyListIterator<String>(this.descriptions);
- }
- public String getDescription(int index) {
- return this.descriptions.get(index);
- }
- public void addDescription(int index, String description) {
- this.descriptions.add(index, description);
- this.fireItemAdded(DESCRIPTIONS_LIST, index, description);
- }
- public void addDescription(String description) {
- this.addDescription(this.descriptions.size(), description);
- }
- public void addDescriptions(ListIterator<String> newDescriptions) {
- while (newDescriptions.hasNext()) {
- this.addDescription(newDescriptions.next());
- }
- }
- public void addDescriptions(List<String> newDescriptions) {
- this.addDescriptions(newDescriptions.listIterator());
- }
- public String removeDescription(int index) {
- String removedDescription = this.descriptions.remove(index);
- this.fireItemRemoved(DESCRIPTIONS_LIST, index, removedDescription);
- return removedDescription;
- }
- public String setDescription(int index, String description) {
- String replacedDescription = this.descriptions.set(index, description);
- this.fireItemReplaced(DESCRIPTIONS_LIST, index, description, replacedDescription);
- return replacedDescription;
- }
- }
-
-
- // this is not a typical aspect adapter - the value is determined by the aspect name
- private class LocalListAspectAdapter extends ListAspectAdapter<TestSubject, String> {
-
- LocalListAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- super(subjectHolder, TestSubject.NAMES_LIST);
- }
-
- @Override
- protected ListIterator<String> listIterator_() {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.names();
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.descriptions();
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public void add(int index, Object item) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- this.subject.addName(index, (String) item);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- this.subject.addDescription(index, (String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public void addAll(int index, List<String> items) {
- for (int i = 0; i < items.size(); i++) {
- this.add(index + i, items.get(i));
- }
- }
-
- public String remove(int index) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.removeName(index);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.removeDescription(index);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public List<String> remove(int index, int length) {
- List<String> removedItems = new ArrayList<String>(length);
- for (int i = 0; i < length; i++) {
- removedItems.add(this.remove(index));
- }
- return removedItems;
- }
-
- public Object replace(int index, Object item) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.setName(index, (String) item);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.setDescription(index, (String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
deleted file mode 100644
index 6ec4c5d711..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ListCollectionValueModelAdapterTests extends TestCase {
- CollectionValueModel<String> adapter;
- private SimpleListValueModel<String> wrappedListHolder;
- private List<String> wrappedList;
-
- public ListCollectionValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedList = new ArrayList<String>();
- this.wrappedListHolder = new SimpleListValueModel<String>(this.wrappedList);
- this.adapter = new ListCollectionValueModelAdapter<String>(this.wrappedListHolder);
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(this.wrappedList.iterator());
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testStaleValues() {
- CollectionChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- };
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
-
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testAdd() {
- Bag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- List<String> synchList = new CoordinatedList<String>(this.wrappedListHolder);
- this.wrappedListHolder.add(0, "foo");
- assertTrue(this.wrappedList.contains("foo"));
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- assertEquals(6, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals(this.wrappedCollection(), CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection(), synchCollection);
- }
-
- public void testRemove() {
- Bag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- List<String> synchList = new CoordinatedList<String>(this.wrappedListHolder);
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- assertEquals("jaz", this.wrappedListHolder.remove(5));
- assertFalse(this.wrappedList.contains("jaz"));
- assertEquals("foo", this.wrappedListHolder.remove(0));
- assertFalse(this.wrappedList.contains("foo"));
- assertEquals(4, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals(this.wrappedCollection(), CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection(), synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- this.wrappedListHolder.remove(5);
- assertFalse(this.wrappedList.contains("jaz"));
- this.wrappedListHolder.remove(0);
- assertFalse(this.wrappedList.contains("foo"));
- assertEquals(4, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testReplace() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {
- assertEquals("foo", e.items().next());
- assertFalse(CollectionTools.contains(ListCollectionValueModelAdapterTests.this.adapter.iterator(), "joo"));
- assertEquals(2, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- assertEquals("joo", e.items().next());
- assertEquals(3, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- });
- this.wrappedListHolder.set(0, "joo");
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- CoordinatedBag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.addCollectionChangeListener(synchCollection);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedListHolder.setList(new ArrayList<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- this.wrappedListHolder.setList(list);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- this.wrappedListHolder.setList(list);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** inner class **********
-
- class TestListener implements CollectionChangeListener {
- public void itemsAdded(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void collectionChanged(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java
deleted file mode 100644
index 692bbcfa54..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListCurator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public final class ListCuratorTests
- extends TestCase
-{
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
-
- private ListCurator<TestSubject, String> curator;
- private ListChangeListener listener1;
- private ListChangeEvent event1;
-
- private TestSubject subject2;
-
- public ListCuratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject(this.subject1Names());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.curator = this.buildListCurator(this.subjectHolder1);
- this.listener1 = this.buildListChangeListener1();
- this.curator.addListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject(this.subject2Names());
- }
-
- private List<String> subject1Names() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("alpha");
- list.add("bravo");
- list.add("charlie");
- list.add("delta");
- return list;
- }
-
- private List<String> subject2Names() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("echo");
- list.add("foxtrot");
- list.add("glove");
- list.add("hotel");
- return list;
- }
-
- private ListCurator<TestSubject, String> buildListCurator(PropertyValueModel<TestSubject> subjectHolder) {
- return new ListCurator<TestSubject, String>(subjectHolder) {
- @Override
- public Iterator<String> iteratorForRecord() {
- return this.subject.strings();
- }
- };
- }
-
- private ListChangeListener buildListChangeListener1() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listCleared(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject2Names(), CollectionTools.list(this.curator.listIterator()));
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- assertFalse(this.curator.iterator().hasNext());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(-1, this.event1.getIndex());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addString("echo");
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject1Names().size(), this.event1.getIndex());
- assertEquals("echo", this.event1.items().next());
- List<String> stringsPlus = this.subject1Names();
- stringsPlus.add("echo");
- assertEquals(stringsPlus, CollectionTools.list(this.curator.listIterator()));
-
- this.event1 = null;
- this.subject1.addString(0, "zulu");
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, this.event1.getIndex());
- assertEquals("zulu", this.event1.items().next());
- stringsPlus.add(0, "zulu");
- assertEquals(stringsPlus, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- String removedString = this.subject1.removeString(0); // should be "alpha"
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, this.event1.getIndex());
- assertEquals(removedString, this.event1.items().next());
- List<String> stringsMinus = this.subject1Names();
- stringsMinus.remove(0);
- assertEquals(stringsMinus, CollectionTools.list(this.curator.listIterator()));
-
- removedString = this.subject1.removeString(2); // should be "delta"
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(2, this.event1.getIndex());
- assertEquals(removedString, this.event1.items().next());
- stringsMinus.remove(2);
- assertEquals(stringsMinus, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testCompleteListChange() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subject1.setStrings(this.subject2Names());
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- List<String> newStrings = this.subject2Names();
- assertEquals(newStrings, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testPartialListChange() {
- List<String> startingList = CollectionTools.list(this.curator.listIterator());
- assertEquals(this.subject1Names(), startingList);
- assertNull(this.event1);
-
- String identicalString = startingList.get(1); // should be "bravo"
- String nonidenticalString = startingList.get(0); // should be "alpha"
- List<String> newStrings = CollectionTools.list(new String[] {new String("bravo"), new String("alpha"), "echo", "delta", "foxtrot"});
- this.subject1.setStrings(newStrings);
-
- List<String> finalList = CollectionTools.list(this.curator.listIterator());
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(newStrings, finalList);
- assertTrue(identicalString == finalList.get(0));
- assertTrue(nonidenticalString != finalList.get(1));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.subject1.strings()));
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testGet() {
- assertEquals(this.subject1Names().get(0), this.subject1.getString(0));
- assertEquals(this.subject1Names().get(0), this.curator.get(0));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.strings()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.curator.listIterator()));
- assertEquals(this.subject1Names().size(), this.curator.size());
- }
-
- public void testHasListeners() {
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener2 = this.buildListChangeListener1();
- this.curator.addListChangeListener(listener2);
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeListChangeListener(listener2);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // **************** Inner Class *******************************************
-
- class TestSubject extends AbstractModel {
- private List<String> strings;
-
- public TestSubject() {
- this.strings = new ArrayList<String>();
- }
-
- public TestSubject(List<String> strings) {
- this();
- this.setStrings(strings);
- }
-
- public String getString(int index) {
- return this.strings.get(index);
- }
-
- public ListIterator<String> strings() {
- return new ReadOnlyListIterator<String>(this.strings);
- }
-
- public void addString(int index, String string) {
- this.strings.add(index, string);
- this.fireStateChanged();
- }
-
- public void addString(String string) {
- this.addString(this.strings.size(), string);
- }
-
- public String removeString(int index) {
- String string = this.strings.get(index);
- this.removeString(string);
- return string;
- }
-
- public void removeString(String string) {
- this.strings.remove(string);
- this.fireStateChanged();
- }
-
- public void setStrings(List<String> strings) {
- this.strings = new ArrayList<String>(strings);
- this.fireStateChanged();
- }
-
- public void setStrings(String[] strings) {
- this.strings = CollectionTools.list(strings);
- this.fireStateChanged();
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java
deleted file mode 100644
index 3fefeb9437..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NullCollectionValueModelTests extends TestCase {
- private CollectionValueModel<Object> collectionHolder;
-
- public NullCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new NullCollectionValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSize() {
- assertEquals(0, this.collectionHolder.size());
- }
-
- public void testIterator() {
- assertFalse(this.collectionHolder.iterator().hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java
deleted file mode 100644
index b4fed3568b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NullListValueModelTests extends TestCase {
- private ListValueModel<Object> listHolder;
-
- public NullListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new NullListValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGet() {
- boolean exCaught = false;
- try {
- this.listHolder.get(0);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testSize() {
- assertEquals(0, this.listHolder.size());
- }
-
- public void testIterator() {
- assertFalse(this.listHolder.iterator().hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java
deleted file mode 100644
index 8dc75dc257..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.NullPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NullPropertyValueModelTests extends TestCase {
- private PropertyValueModel<Object> valueHolder;
-
- public NullPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new NullPropertyValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertNull(this.valueHolder.getValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
deleted file mode 100644
index 9d12a06466..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PropertyAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private PropertyAspectAdapter<TestSubject, String> aa1;
- private PropertyChangeEvent event1;
- private PropertyChangeListener listener1;
-
- private TestSubject subject2;
-
- private PropertyChangeEvent multipleValueEvent;
-
- private PropertyChangeEvent customValueEvent;
-
-
- public PropertyAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject("foo", "test subject 1");
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject> (this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject("bar", "test subject 2");
- }
-
- private PropertyAspectAdapter<TestSubject, String> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY) {
- // this is not a aspect adapter - the value is determined by the aspect name
- @Override
- protected String buildValue_() {
- if (this.propertyNames[0] == TestSubject.NAME_PROPERTY) {
- return this.subject.getName();
- } else if (this.propertyNames[0] == TestSubject.DESCRIPTION_PROPERTY) {
- return this.subject.getDescription();
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.propertyNames[0]);
- }
- }
- @Override
- protected void setValue_(String value) {
- if (this.propertyNames[0] == TestSubject.NAME_PROPERTY) {
- this.subject.setName(value);
- } else if (this.propertyNames[0] == TestSubject.DESCRIPTION_PROPERTY) {
- this.subject.setDescription(value);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.propertyNames[0]);
- }
- }
- };
- }
-
- private PropertyChangeListener buildValueChangeListener1() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(PropertyChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals("foo", this.aa1.getValue());
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("foo", this.event1.getOldValue());
- assertEquals("bar", this.event1.getNewValue());
- assertEquals("bar", this.aa1.getValue());
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("bar", this.event1.getOldValue());
- assertNull(this.event1.getNewValue());
- assertNull(this.aa1.getValue());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals(null, this.event1.getOldValue());
- assertEquals("foo", this.event1.getNewValue());
- assertEquals("foo", this.aa1.getValue());
- }
-
- public void testPropertyChange() {
- assertEquals("foo", this.aa1.getValue());
- assertNull(this.event1);
-
- this.subject1.setName("baz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("foo", this.event1.getOldValue());
- assertEquals("baz", this.event1.getNewValue());
- assertEquals("baz", this.aa1.getValue());
-
- this.event1 = null;
- this.subject1.setName(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("baz", this.event1.getOldValue());
- assertEquals(null, this.event1.getNewValue());
- assertEquals(null, this.aa1.getValue());
-
- this.event1 = null;
- this.subject1.setName("foo");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals(null, this.event1.getOldValue());
- assertEquals("foo", this.event1.getNewValue());
- assertEquals("foo", this.aa1.getValue());
- }
-
- public void testValue() {
- assertEquals("foo", this.subject1.getName());
- assertEquals("foo", this.aa1.getValue());
- }
-
- public void testStaleValue() {
- assertEquals("foo", this.subject1.getName());
- assertEquals("foo", this.aa1.getValue());
-
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals(null, this.aa1.getValue());
-
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals("foo", this.aa1.getValue());
-
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- this.subjectHolder1.setValue(this.subject2);
- assertEquals(null, this.aa1.getValue());
-
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals("bar", this.aa1.getValue());
- }
-
- public void testSetValue() {
- this.aa1.setValue("baz");
- assertEquals("baz", this.aa1.getValue());
- assertEquals("baz", this.subject1.getName());
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertFalse(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- assertFalse(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addPropertyChangeListener(listener2);
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removePropertyChangeListener(listener2);
- assertFalse(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- assertFalse(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testMultipleAspectAdapter() {
- TestSubject testSubject = new TestSubject("fred", "husband");
- WritablePropertyValueModel<TestSubject> testSubjectHolder = new SimplePropertyValueModel<TestSubject>(testSubject);
- WritablePropertyValueModel<String> testAA = this.buildMultipleAspectAdapter(testSubjectHolder);
- PropertyChangeListener testListener = this.buildMultipleValueChangeListener();
- testAA.addPropertyChangeListener(PropertyValueModel.VALUE, testListener);
- assertEquals("fred:husband", testAA.getValue());
-
- this.multipleValueEvent = null;
- testSubject.setName("wilma");
- assertEquals("wilma:husband", testAA.getValue());
- assertEquals("fred:husband", this.multipleValueEvent.getOldValue());
- assertEquals("wilma:husband", this.multipleValueEvent.getNewValue());
-
- this.multipleValueEvent = null;
- testSubject.setDescription("wife");
- assertEquals("wilma:wife", testAA.getValue());
- assertEquals("wilma:husband", this.multipleValueEvent.getOldValue());
- assertEquals("wilma:wife", this.multipleValueEvent.getNewValue());
- }
-
- private WritablePropertyValueModel<String> buildMultipleAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY, TestSubject.DESCRIPTION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName() + ":" + this.subject.getDescription();
- }
- };
- }
-
- private PropertyChangeListener buildMultipleValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.multipleValueChanged(e);
- }
- };
- }
-
- void multipleValueChanged(PropertyChangeEvent e) {
- this.multipleValueEvent = e;
- }
-
- /**
- * test a bug where we would call #buildValue() in
- * #engageNonNullSubject(), when we needed to call
- * it in #engageSubject(), so the cached value would
- * be rebuilt when the this.subject was set to null
- */
- public void testCustomBuildValueWithNullSubject() {
- TestSubject customSubject = new TestSubject("fred", "laborer");
- WritablePropertyValueModel<TestSubject> customSubjectHolder = new SimplePropertyValueModel<TestSubject>(customSubject);
- WritablePropertyValueModel<String> customAA = this.buildCustomAspectAdapter(customSubjectHolder);
- PropertyChangeListener customListener = this.buildCustomValueChangeListener();
- customAA.addPropertyChangeListener(PropertyValueModel.VALUE, customListener);
- assertEquals("fred", customAA.getValue());
-
- this.customValueEvent = null;
- customSubject.setName("wilma");
- assertEquals("wilma", customAA.getValue());
- assertEquals("fred", this.customValueEvent.getOldValue());
- assertEquals("wilma", this.customValueEvent.getNewValue());
-
- this.customValueEvent = null;
- customSubjectHolder.setValue(null);
- // this would fail - the value would be null...
- assertEquals("<unnamed>", customAA.getValue());
- assertEquals("wilma", this.customValueEvent.getOldValue());
- assertEquals("<unnamed>", this.customValueEvent.getNewValue());
- }
-
- private WritablePropertyValueModel<String> buildCustomAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY) {
- @Override
- protected String buildValue() {
- return (this.subject == null) ? "<unnamed>" : this.subject.getName();
- }
- };
- }
-
- private PropertyChangeListener buildCustomValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.customValueChanged(e);
- }
- };
- }
-
- void customValueChanged(PropertyChangeEvent e) {
- this.customValueEvent = e;
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private String description;
- public static final String DESCRIPTION_PROPERTY = "description";
-
- public TestSubject(String name, String description) {
- this.name = name;
- this.description = description;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- public String getDescription() {
- return this.description;
- }
- public void setDescription(String description) {
- Object old = this.description;
- this.description = description;
- this.firePropertyChanged(DESCRIPTION_PROPERTY, old, description);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
deleted file mode 100644
index 3dbf87c0de..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import javax.swing.JList;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PropertyCollectionValueModelAdapterTests extends TestCase {
- private CollectionValueModel<String> adapter;
- private WritablePropertyValueModel<String> wrappedValueHolder;
-
- public PropertyCollectionValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedValueHolder = new SimplePropertyValueModel<String>();
- this.adapter = new PropertyCollectionValueModelAdapter<String>(this.wrappedValueHolder);
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(new SingleElementIterator<String>(this.wrappedValueHolder.getValue()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
- }
-
- public void testStaleValue() {
- CollectionChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- };
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- this.wrappedValueHolder.setValue("foo");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
-
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- CoordinatedBag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.addCollectionChangeListener(synchCollection);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue("foo");
- assertEquals(1, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener());
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** member class **********
-
- static class TestListener implements CollectionChangeListener {
- public void collectionChanged(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
deleted file mode 100644
index 528bd3b6a1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PropertyListValueModelAdapterTests extends TestCase {
- private ListValueModel<String> adapter;
- private WritablePropertyValueModel<String> wrappedValueHolder;
-
- public PropertyListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedValueHolder = new SimplePropertyValueModel<String>();
- this.adapter = new PropertyListValueModelAdapter<String>(this.wrappedValueHolder);
- }
-
- private Collection<String> wrappedList() {
- return CollectionTools.list(new SingleElementIterator<String>(this.wrappedValueHolder.getValue()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- assertFalse(this.adapter.iterator().hasNext());
- this.wrappedValueHolder.setValue("foo");
- List<String> adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
- }
-
- public void testGetInt() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- assertEquals("foo", this.adapter.get(0));
- }
-
- public void testToArray1() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- Object[] array = this.adapter.toArray();
- assertEquals("foo", array[0]);
- assertEquals(1, array.length);
- }
-
- public void testToArray2() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener());
- Object[] array = this.adapter.toArray();
- assertEquals(0, array.length);
- }
-
- public void testStaleValue() {
- ListChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- };
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- this.wrappedValueHolder.setValue("foo");
- List<String> adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
-
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(0, adapterList.size());
- assertEquals(new ArrayList<String>(), adapterList);
-
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.wrappedValueHolder.setValue("foo");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsRemoved(ListChangeEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testListChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue("foo");
- assertEquals(1, jList.getModel().getSize());
- }
-
- public void testListItemChanged() {
- this.wrappedValueHolder.setValue("foo");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsReplaced(ListChangeEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
- assertEquals(1, jList.getModel().getSize());
- assertEquals("foo", jList.getModel().getElementAt(0));
-
- this.wrappedValueHolder.setValue("bar");
- assertEquals(1, jList.getModel().getSize());
- assertEquals("bar", jList.getModel().getElementAt(0));
- }
-
- public void testListChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener());
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** member class **********
-
- static class TestListener implements ListChangeListener {
- public void listChanged(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent event) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
deleted file mode 100644
index 0f2ed43ee3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SimpleCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> bagHolder;
- CollectionChangeEvent bagEvent;
- String bagEventType;
-
- private SimpleCollectionValueModel<String> setHolder;
- CollectionChangeEvent setEvent;
- String setEventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String CHANGE = "change";
- private static final String CLEAR = "clear";
-
-
- public SimpleCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bagHolder = new SimpleCollectionValueModel<String>(this.buildBag());
- this.setHolder = new SimpleCollectionValueModel<String>(this.buildSet());
- }
-
- private Bag<String> buildBag() {
- Bag<String> result = new HashBag<String>();
- this.addItemsTo(result);
- return result;
- }
-
- private Set<String> buildSet() {
- Set<String> result = new HashSet<String>();
- this.addItemsTo(result);
- return result;
- }
-
- private void addItemsTo(Collection<String> c) {
- c.add("foo");
- c.add("bar");
- c.add("baz");
- }
-
- private Bag<String> buildAddItems() {
- Bag<String> result = new HashBag<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
- private Bag<String> buildRemoveItems() {
- Bag<String> result = new HashBag<String>();
- result.add("foo");
- result.add("baz");
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(this.buildBag(), CollectionTools.bag(this.bagHolder.iterator()));
- assertEquals(this.buildSet(), CollectionTools.set(this.setHolder.iterator()));
- }
-
- public void testSize() {
- assertEquals(this.buildBag().size(), CollectionTools.size(this.bagHolder.iterator()));
- assertEquals(this.buildSet().size(), CollectionTools.size(this.setHolder.iterator()));
- }
-
- private boolean bagHolderContains(Object item) {
- return CollectionTools.contains(this.bagHolder.iterator(), item);
- }
-
- private boolean setHolderContains(Object item) {
- return CollectionTools.contains(this.setHolder.iterator(), item);
- }
-
- private boolean bagHolderContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.bagHolder.iterator(), items);
- }
-
- private boolean setHolderContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.setHolder.iterator(), items);
- }
-
- private boolean bagHolderContainsAny(Collection<String> items) {
- Bag<String> bag = CollectionTools.bag(this.bagHolder.iterator());
- for (String string : items) {
- if (bag.contains(string)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean setHolderContainsAny(Collection<String> items) {
- Set<String> set = CollectionTools.set(this.setHolder.iterator());
- for (String string : items) {
- if (set.contains(string)) {
- return true;
- }
- }
- return false;
- }
-
- public void testAdd() {
- assertFalse(this.bagHolderContains("joo"));
- this.bagHolder.add("joo");
- assertTrue(this.bagHolderContains("joo"));
-
- assertFalse(this.bagHolderContains(null));
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
-
- assertFalse(this.setHolderContains("joo"));
- this.setHolder.add("joo");
- assertTrue(this.setHolderContains("joo"));
-
- assertFalse(this.setHolderContains(null));
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- }
-
- public void testAddAll() {
- assertFalse(this.bagHolderContainsAny(this.buildAddItems()));
- this.bagHolder.addAll(this.buildAddItems());
- assertTrue(this.bagHolderContainsAll(this.buildAddItems()));
-
- assertFalse(this.setHolderContainsAny(this.buildAddItems()));
- this.setHolder.addAll(this.buildAddItems());
- assertTrue(this.setHolderContainsAll(this.buildAddItems()));
- }
-
- public void testRemove() {
- assertTrue(this.bagHolderContains("bar"));
- this.bagHolder.remove("bar");
- assertFalse(this.bagHolderContains("bar"));
-
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
- this.bagHolder.remove(null);
- assertFalse(this.bagHolderContains(null));
-
- assertTrue(this.setHolderContains("bar"));
- this.setHolder.remove("bar");
- assertFalse(this.setHolderContains("bar"));
-
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- this.setHolder.remove(null);
- assertFalse(this.setHolderContains(null));
- }
-
- public void testRemoveAll() {
- assertTrue(this.bagHolderContainsAll(this.buildRemoveItems()));
- this.bagHolder.removeAll(this.buildRemoveItems());
- assertFalse(this.bagHolderContainsAny(this.buildRemoveItems()));
-
- assertTrue(this.setHolderContainsAll(this.buildRemoveItems()));
- this.setHolder.removeAll(this.buildRemoveItems());
- assertFalse(this.setHolderContainsAny(this.buildRemoveItems()));
- }
-
- public void testSetCollection() {
- assertTrue(this.bagHolderContains("bar"));
- assertFalse(this.bagHolderContains("jar"));
- this.bagHolder.setCollection(this.buildAddItems());
- assertFalse(this.bagHolderContains("bar"));
- assertTrue(this.bagHolderContains("jar"));
-
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
- this.bagHolder.remove(null);
- assertFalse(this.bagHolderContains(null));
-
- this.bagHolder.setCollection(new HashBag<String>());
- assertFalse(this.bagHolderContains("jar"));
-
- assertTrue(this.setHolderContains("bar"));
- assertFalse(this.setHolderContains("jar"));
- this.setHolder.setCollection(this.buildAddItems());
- assertFalse(this.setHolderContains("bar"));
- assertTrue(this.setHolderContains("jar"));
-
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- this.setHolder.remove(null);
- assertFalse(this.setHolderContains(null));
-
- this.setHolder.setCollection(new HashBag<String>());
- assertFalse(this.setHolderContains("jar"));
- }
-
- public void testCollectionChange1() {
- this.bagHolder.addCollectionChangeListener(this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addCollectionChangeListener(this.buildSetListener());
- this.verifySetChange();
- }
-
- public void testCollectionChange2() {
- this.bagHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildSetListener());
- this.verifySetChange();
- }
-
- private void verifyBagChange() {
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("foo");
- this.verifyBagEvent(ADD, "foo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("foo");
- this.verifyBagEvent(ADD, "foo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("joo");
- this.verifyBagEvent(ADD, "joo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add(null);
- this.verifyBagEvent(ADD, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add(null);
- this.verifyBagEvent(ADD, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.remove("joo");
- this.verifyBagEvent(REMOVE, "joo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.remove(null);
- this.verifyBagEvent(REMOVE, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.setCollection(this.buildBag());
- this.verifyBagEvent(CHANGE);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.addAll(this.buildBag());
- this.verifyBagEvent(ADD);
- assertEquals(this.buildBag(), CollectionTools.bag(this.bagEvent.items()));
- }
-
- private void verifySetChange() {
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("foo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("joo");
- this.verifySetEvent(ADD, "joo");
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("joo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add(null);
- this.verifySetEvent(ADD, null);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add(null);
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove("joo");
- this.verifySetEvent(REMOVE, "joo");
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove("joo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove(null);
- this.verifySetEvent(REMOVE, null);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.setCollection(this.buildSet());
- this.verifySetEvent(CHANGE);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.addAll(this.buildSet());
- assertNull(this.setEvent);
- assertNull(this.setEventType);
- }
-
- private CollectionChangeListener buildBagListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = ADD;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = REMOVE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CLEAR;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CHANGE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildSetListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = ADD;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = REMOVE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CLEAR;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CHANGE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- };
- }
-
- private void verifyBagEvent(String eventType) {
- assertEquals(eventType, this.bagEventType);
- assertEquals(this.bagHolder, this.bagEvent.getSource());
- assertEquals(CollectionValueModel.VALUES, this.bagEvent.getCollectionName());
- }
-
- private void verifyBagEvent(String eventType, Object item) {
- this.verifyBagEvent(eventType);
- assertEquals(item, this.bagEvent.items().next());
- }
-
- private void verifySetEvent(String eventType) {
- assertEquals(eventType, this.setEventType);
- assertEquals(this.setHolder, this.setEvent.getSource());
- assertEquals(CollectionValueModel.VALUES, this.setEvent.getCollectionName());
- }
-
- private void verifySetEvent(String eventType, Object item) {
- this.verifySetEvent(eventType);
- assertEquals(item, this.setEvent.items().next());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java
deleted file mode 100644
index 39f54c1dfb..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SimpleListValueModelTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- ListChangeEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
-
- public SimpleListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- return result;
- }
-
- private List<String> buildAddList() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
-// private List<String> buildRemoveList() {
-// List<String> result = new ArrayList<String>();
-// result.add("foo");
-// result.add("bar");
-// return result;
-// }
-//
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(this.buildList(), CollectionTools.list(this.listHolder.iterator()));
- }
-
- public void testListIterator() {
- assertEquals(this.buildList(), CollectionTools.list(this.listHolder.listIterator()));
- }
-
- public void testListIteratorInt() {
- assertEquals(CollectionTools.list(this.buildList().listIterator(1)), CollectionTools.list(this.listHolder.listIterator(1)));
- }
-
- public void testSize() {
- assertEquals(this.buildList().size(), this.listHolder.size());
- }
-
- private boolean listContains(Object item) {
- return CollectionTools.contains(this.listHolder.listIterator(), item);
- }
-
- private boolean listContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.listHolder.listIterator(), items);
- }
-
- private boolean listContainsAny(Collection<String> items) {
- Set<String> set = CollectionTools.set(this.listHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (set.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- public void testAddObject() {
- assertFalse(this.listContains("joo"));
- this.listHolder.add("joo");
- assertTrue(this.listContains("joo"));
-
- assertFalse(this.listContains(null));
- this.listHolder.add(null);
- assertTrue(this.listContains(null));
- }
-
- public void testAddIntObject() {
- assertFalse(this.listContains("joo"));
- this.listHolder.add(2, "joo");
- assertTrue(this.listContains("joo"));
-
- assertFalse(this.listContains(null));
- this.listHolder.add(0, null);
- assertTrue(this.listContains(null));
- }
-
- public void testAddAllCollection() {
- assertFalse(this.listContainsAny(this.buildAddList()));
- this.listHolder.addAll(this.buildAddList());
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testAddAllIntCollection() {
- assertFalse(this.listContainsAny(this.buildAddList()));
- this.listHolder.addAll(2, this.buildAddList());
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testClear() {
- assertFalse(this.listHolder.isEmpty());
- this.listHolder.clear();
- assertTrue(this.listHolder.isEmpty());
- }
-
- public void testContainsObject() {
- assertTrue(this.listHolder.contains("foo"));
- assertFalse(this.listHolder.contains("joo"));
- }
-
- public void testContainsAllCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add("foo");
- c.add("bar");
- assertTrue(this.listHolder.containsAll(c));
-
- c.add("joo");
- assertFalse(this.listHolder.containsAll(c));
- }
-
- public void testEquals() {
- assertEquals(new SimpleListValueModel<String>(this.buildList()), this.listHolder);
- assertFalse(this.listHolder.equals(new SimpleListValueModel<String>(this.buildAddList())));
- assertFalse(this.listHolder.equals(this.buildList()));
- assertFalse(this.listHolder.equals(new SimpleListValueModel<String>()));
- }
-
- public void testGetInt() {
- assertEquals("foo", this.listHolder.get(0));
- assertEquals("bar", this.listHolder.get(1));
- assertEquals("baz", this.listHolder.get(2));
- }
-
- public void testHashCode() {
- assertEquals(new SimpleListValueModel<String>(this.buildList()).hashCode(), this.listHolder.hashCode());
- }
-
- public void testIndexOfObject() {
- assertEquals(0, this.listHolder.indexOf("foo"));
- assertEquals(1, this.listHolder.indexOf("bar"));
- assertEquals(2, this.listHolder.indexOf("baz"));
- assertEquals(-1, this.listHolder.indexOf("joo"));
- }
-
- public void testLastIndexOfObject() {
- assertEquals(0, this.listHolder.lastIndexOf("foo"));
- assertEquals(1, this.listHolder.lastIndexOf("bar"));
- assertEquals(2, this.listHolder.lastIndexOf("baz"));
- assertEquals(-1, this.listHolder.lastIndexOf("joo"));
-
- this.listHolder.add("foo");
- assertEquals(3, this.listHolder.lastIndexOf("foo"));
- }
-
- public void testIsEmpty() {
- assertFalse(this.listHolder.isEmpty());
- this.listHolder.clear();
- assertTrue(this.listHolder.isEmpty());
- }
-
- public void testRemove() {
- assertTrue(this.listContains("bar"));
- this.listHolder.remove(this.buildList().indexOf("bar"));
- assertFalse(this.listContains("bar"));
-
- this.listHolder.add(1, null);
- assertTrue(this.listContains(null));
- this.listHolder.remove(1);
- assertFalse(this.listContains(null));
- }
-
- public void testSetValues() {
- List<String> newList = new ArrayList<String>();
- newList.add("joo");
- newList.add("jar");
- newList.add("jaz");
-
- assertTrue(this.listContains("bar"));
- assertFalse(this.listContains("jar"));
- this.listHolder.setList(newList);
- assertFalse(this.listContains("bar"));
- assertTrue(this.listContains("jar"));
-
- this.listHolder.add(1, null);
- assertTrue(this.listContains(null));
- this.listHolder.remove(1);
- assertFalse(this.listContains(null));
-
- this.listHolder.setList(new ArrayList<String>());
- assertFalse(this.listContains("jar"));
- }
-
- public void testListChange1() {
- this.listHolder.addListChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChange2() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, "joo");
- this.verifyEvent(ADD, 1, "joo");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, null);
- this.verifyEvent(ADD, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, "joo");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.setList(this.buildList());
- this.verifyEvent(CHANGE);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildList(), CollectionTools.list(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "foo"));
- assertTrue(CollectionTools.contains(this.event.items(), "joo"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = ADD;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = REMOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = REPLACE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = MOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CLEAR;
- SimpleListValueModelTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CHANGE;
- SimpleListValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String e) {
- assertEquals(e, this.eventType);
- assertEquals(this.listHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.getListName());
- }
-
- private void verifyEvent(String e, int index, Object item) {
- this.verifyEvent(e);
- assertEquals(index, this.event.getIndex());
- assertEquals(item, this.event.items().next());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
deleted file mode 100644
index e6bea20a70..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SimplePropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
-
- public SimplePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- }
-
- public void testSetValue() {
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- this.objectHolder.setValue(null);
- assertEquals(null, this.objectHolder.getValue());
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.verifyPropertyChange();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyPropertyChange();
- }
-
- private void verifyPropertyChange() {
- this.event = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent("foo", "bar");
-
- this.event = null;
- this.objectHolder.setValue(null);
- this.verifyEvent("bar", null);
-
- this.event = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(null, "baz");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- SimplePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(Object oldValue, Object newValue) {
- assertEquals(this.objectHolder, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.getPropertyName());
- assertEquals(oldValue, this.event.getOldValue());
- assertEquals(newValue, this.event.getNewValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
deleted file mode 100644
index d867d2275f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.TreeSet;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SortedListValueModelAdapterTests extends TestCase {
- private SortedListValueModelAdapter<String> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- private Collection<String> wrappedCollection;
-
-
- public SortedListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollection = new HashBag<String>();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>(this.wrappedCollection);
- this.adapter = new SortedListValueModelAdapter<String>(this.wrappedCollectionHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual) {
- this.verifyList(expected, actual, null);
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual, Comparator<String> comparator) {
- Collection<String> sortedSet = new TreeSet<String>(comparator);
- sortedSet.addAll(expected);
- List<String> expectedList = new ArrayList<String>(sortedSet);
- List<String> actualList = CollectionTools.list(actual.iterator());
- assertEquals(expectedList, actualList);
- }
-
- public void testAdd() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- assertEquals(3, this.adapter.size());
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- public void testAddItem() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testRemoveItem() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- public void testSetComparator() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
-
- this.adapter.setComparator(new ReverseComparator<String>());
- this.verifyList(this.wrappedCollection, this.adapter, new ReverseComparator<String>());
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
deleted file mode 100644
index b2839e2299..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class StaticCollectionValueModelTests extends TestCase {
-
- private static final Collection<String> COLLECTION = buildCollection();
- private static Collection<String> buildCollection() {
- Collection<String> result = new HashBag<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private CollectionValueModel<String> collectionHolder;
-
-
- public StaticCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = this.buildCollectionHolder();
- }
-
- private CollectionValueModel<String> buildCollectionHolder() {
- return new StaticCollectionValueModel<String>(COLLECTION);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(buildCollection(), CollectionTools.bag(this.collectionHolder.iterator()));
- }
-
- public void testSize() {
- assertEquals(buildCollection().size(), this.collectionHolder.size());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java
deleted file mode 100644
index 65dd9ef176..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class StaticListValueModelTests extends TestCase {
-
- private static final List<String> LIST = buildList();
- private static List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private ListValueModel<String> listHolder;
-
-
- public StaticListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new StaticListValueModel<String>(LIST);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGet() {
- List<String> expected = buildList();
- for (int i = 0; i < this.listHolder.size(); i++) {
- assertEquals(expected.get(i), this.listHolder.get(i));
- }
- }
-
- public void testIterator() {
- assertEquals(buildList(), CollectionTools.list(this.listHolder.listIterator()));
- }
-
- public void testSize() {
- assertEquals(buildList().size(), this.listHolder.size());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java
deleted file mode 100644
index c894e7183c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class StaticValueModelTests extends TestCase {
- private PropertyValueModel<String> objectHolder;
- private static final PropertyValueModel<String> OBJECT_HOLDER = new StaticPropertyValueModel<String>("foo");
-
-
- public StaticValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = OBJECT_HOLDER;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- }
-
- public void testToString() {
- assertTrue(this.objectHolder.toString().indexOf("foo") >= 0);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java
deleted file mode 100644
index 8147853a51..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class TransformationListValueModelAdapterTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> transformedListHolder;
- ListChangeEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
-
- public TransformationListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- this.transformedListHolder = this.buildTransformedListHolder(this.listHolder);
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- return result;
- }
-
- private List<String> buildTransformedList() {
- return this.transform(this.buildList());
- }
-
- private List<String> transform(List<String> list) {
- List<String> result = new ArrayList<String>(list.size());
- for (String string : list) {
- if (string == null) {
- result.add(null);
- } else {
- result.add(string.toUpperCase());
- }
- }
- return result;
- }
-
- private List<String> buildAddList() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
- private List<String> buildTransformedAddList() {
- return this.transform(this.buildAddList());
- }
-
-// private List<String> buildRemoveList() {
-// List<String> result = new ArrayList<String>();
-// result.add("foo");
-// result.add("bar");
-// return result;
-// }
-//
-// private List<String> buildTransformedRemoveList() {
-// return this.transform(this.buildRemoveList());
-// }
-//
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModelAdapter<String, String>(lvm) {
- @Override
- protected String transformItem(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.transformedListHolder.iterator()));
- }
-
- public void testStaleValues() {
- ListChangeListener listener = this.buildListener();
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.transformedListHolder.iterator()));
-
- this.transformedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertEquals(Collections.EMPTY_LIST, CollectionTools.list(this.transformedListHolder.iterator()));
- }
-
- public void testSize() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildTransformedList().size(), CollectionTools.size(this.transformedListHolder.iterator()));
- }
-
- private boolean transformedListContains(Object item) {
- return CollectionTools.contains(this.transformedListHolder.iterator(), item);
- }
-
- private boolean transformedListContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.transformedListHolder.iterator(), items);
- }
-
- private boolean transformedListContainsAny(Collection<String> items) {
- List<String> transformedList = CollectionTools.list(this.transformedListHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (transformedList.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- public void testAdd() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.transformedListContains("JOO"));
- this.listHolder.add(2, "joo");
- assertTrue(this.transformedListContains("JOO"));
-
- assertFalse(this.transformedListContains(null));
- this.listHolder.add(0, null);
- assertTrue(this.transformedListContains(null));
- }
-
- public void testAddAll() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.transformedListContainsAny(this.buildTransformedAddList()));
- this.listHolder.addAll(2, this.buildAddList());
- assertTrue(this.transformedListContainsAll(this.buildTransformedAddList()));
- }
-
- public void testRemove() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertTrue(this.transformedListContains("BAR"));
- this.listHolder.remove(this.buildList().indexOf("bar"));
- assertFalse(this.transformedListContains("BAR"));
-
- this.listHolder.add(1, null);
- assertTrue(this.transformedListContains(null));
- this.listHolder.remove(1);
- assertFalse(this.transformedListContains(null));
- }
-
- public void testListChangeGeneric() {
- this.transformedListHolder.addListChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChangeNamed() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, "joo");
- this.verifyEvent(ADD, 1, "JOO");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, null);
- this.verifyEvent(ADD, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, "JOO");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "FOO"));
- assertTrue(CollectionTools.contains(this.event.items(), "JOO"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = ADD;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REMOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REPLACE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = MOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CLEAR;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CHANGE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String type) {
- assertEquals(type, this.eventType);
- assertEquals(this.transformedListHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.getListName());
- }
-
- private void verifyEvent(String type, int index, Object item) {
- this.verifyEvent(type);
- assertEquals(index, this.event.getIndex());
- assertEquals(item, this.event.items().next());
- }
-
- public void testHasListeners() {
- /*
- * adding listeners to the transformed list will cause listeners
- * to be added to the wrapped list;
- * likewise, removing listeners from the transformed list will
- * cause listeners to be removed from the wrapped list
- */
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener = this.buildListener();
-
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.addListChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeListChangeListener(listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- /**
- * execute the same set of tests again, but by passing a Transformer to the adapter
- * (as opposed to overriding #transformItem(Object))
- */
- public static class TransformerTests extends TransformationListValueModelAdapterTests {
- public TransformerTests(String name) {
- super(name);
- }
- @Override
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModelAdapter<String, String>(lvm, this.buildTransformer());
- }
- private Transformer<String, String> buildTransformer() {
- return new Transformer<String, String>() {
- public String transform(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- };
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
deleted file mode 100644
index 398c67a060..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("nls")
-public class TransformationPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public TransformationPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.transformationObjectHolder = new TransformationWritablePropertyValueModel<String, String>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<String, String> buildTransformer() {
- return new BidiTransformer<String, String>() {
- public String transform(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- public String reverseTransform(String s) {
- return (s == null) ? null : s.toLowerCase();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("FOO", this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("BAR", this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertEquals("BAZ", this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("FOO", this.transformationObjectHolder.getValue());
- }
-
- public void testSetValue() {
- this.transformationObjectHolder.setValue("BAR");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("BAR", this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue("Foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("FOO", this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertEquals("BAZ", this.transformationObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, "foo", "bar");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", "BAR");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(this.event, this.objectHolder, "bar", "baz");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAR", "BAZ");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("Foo");
- this.verifyEvent(this.event, this.objectHolder, "baz", "Foo");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAZ", "FOO");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("FOO");
- this.verifyEvent(this.event, this.objectHolder, "Foo", "FOO");
- assertNull(this.transformationEvent);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, "FOO", null);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", null);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, null, "bar");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, "BAR");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java
deleted file mode 100644
index ef59751c50..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TreeAspectAdapter;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class TreeAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private TreeAspectAdapter<TestSubject, TestNode[]> aa1;
- private TreeChangeEvent event1;
- private TreeChangeListener listener1;
-
- private TestSubject subject2;
-
-
- public TreeAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- TestNode root, node;
-
- root = this.subject1.getRootNameNode();
- node = this.subject1.addName(root, "name 1.1");
- this.subject1.addName(node, "name 1.1.1");
- this.subject1.addName(node, "name 1.1.2");
- node = this.subject1.addName(root, "name 1.2");
- this.subject1.addName(node, "name 1.2.1");
- node = this.subject1.addName(root, "name 1.3");
-
- root = this.subject1.getRootDescriptionNode();
- node = this.subject1.addDescription(root, "description 1.1");
- this.subject1.addDescription(node, "description 1.1.1");
- this.subject1.addDescription(node, "description 1.1.2");
- node = this.subject1.addDescription(root, "description 1.2");
- this.subject1.addDescription(node, "description 1.2.1");
- node = this.subject1.addDescription(root, "description 1.3");
-
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addTreeChangeListener(TreeValueModel.NODES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject();
-
- root = this.subject2.getRootNameNode();
- node = this.subject2.addName(root, "name 2.1");
- this.subject2.addName(node, "name 2.1.1");
- this.subject2.addName(node, "name 2.1.2");
- node = this.subject2.addName(root, "name 2.2");
- this.subject2.addName(node, "name 2.2.1");
- node = this.subject2.addName(root, "name 2.3");
-
- root = this.subject2.getRootDescriptionNode();
- node = this.subject2.addDescription(root, "description 2.1");
- this.subject2.addDescription(node, "description 2.1.1");
- this.subject2.addDescription(node, "description 2.1.2");
- node = this.subject2.addDescription(root, "description 2.2");
- this.subject2.addDescription(node, "description 2.2.1");
- node = this.subject2.addDescription(root, "description 2.3");
- }
-
- private TreeAspectAdapter<TestSubject, TestNode[]> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new TreeAspectAdapter<TestSubject, TestNode[]>(subjectHolder, TestSubject.NAMES_TREE) {
- // this is not a typical aspect adapter - the value is determined by the aspect name
- @Override
- protected Iterator<TestNode[]> nodes_() {
- if (this.treeNames[0] == TestSubject.NAMES_TREE) {
- return this.subject.namePaths();
- }
- if (this.treeNames[0] == TestSubject.DESCRIPTIONS_TREE) {
- return this.subject.descriptionPaths();
- }
- throw new IllegalStateException("invalid aspect name: " + this.treeNames[0]);
- }
- };
- }
-
- private TreeChangeListener buildValueChangeListener1() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void nodeRemoved(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void treeCleared(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void treeChanged(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(TreeChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- assertEquals(0, this.event1.getPath().length);
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- assertEquals(0, this.event1.getPath().length);
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- assertEquals(0, this.event1.getPath().length);
- }
-
- public void testTreeStructureChange() {
- assertNull(this.event1);
-
- this.subject1.addTwoNames(this.subject1.getRootNameNode(), "jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- Object[] path = this.event1.getPath();
- assertEquals(this.subject1.getRootNameNode(), path[path.length - 1]);
- assertTrue(this.subject1.containsNameNode("jam"));
- assertTrue(this.subject1.containsNameNode("jaz"));
- }
-
- public void testNodes() {
- assertEquals(this.convertToNames(this.subject1.namePaths()), this.convertToNames(this.aa1.nodes()));
- }
-
- private Collection<String> convertToNames(Iterator<TestNode[]> namePaths) {
- Collection<String> result = new HashBag<String>();
- while (namePaths.hasNext()) {
- Object[] path = namePaths.next();
- StringBuffer sb = new StringBuffer();
- sb.append('[');
- for (int i = 0; i < path.length; i++) {
- sb.append(((TestNode) path[i]).getText());
- if (i < path.length - 1) {
- sb.append(':');
- }
- }
- sb.append(']');
- result.add(sb.toString());
- }
- return result;
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeTreeChangeListener(TreeValueModel.NODES, this.listener1);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
-
- TreeChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addTreeChangeListener(listener2);
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeTreeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- }
-
- // ********** inner classes **********
-
- private class TestSubject extends AbstractModel {
- private TestNode rootNameNode;
- public static final String NAMES_TREE = "names";
- private TestNode rootDescriptionNode;
- public static final String DESCRIPTIONS_TREE = "descriptions";
-
- public TestSubject() {
- this.rootNameNode = new TestNode("root name");
- this.rootDescriptionNode = new TestNode("root description");
- }
- public TestNode getRootNameNode() {
- return this.rootNameNode;
- }
- public Iterator<TestNode> nameNodes() {
- return new TreeIterator<TestNode>(this.rootNameNode) {
- @Override
- public Iterator<TestNode> children(TestNode next) {
- return next.children();
- }
- };
- }
- public Iterator<TestNode[]> namePaths() {
- return new TransformationIterator<TestNode, TestNode[]>(this.nameNodes()) {
- @Override
- protected TestNode[] transform(TestNode next) {
- return next.path();
- }
- };
- }
- public TestNode addName(TestNode parent, String name) {
- TestNode child = new TestNode(name);
- parent.addChild(child);
- this.fireNodeAdded(NAMES_TREE, child.path());
- return child;
- }
- public void addTwoNames(TestNode parent, String name1, String name2) {
- parent.addChild(new TestNode(name1));
- parent.addChild(new TestNode(name2));
- this.fireTreeChanged(NAMES_TREE, parent.path());
- }
- public void removeNameNode(TestNode nameNode) {
- nameNode.getParent().removeChild(nameNode);
- this.fireNodeRemoved(NAMES_TREE, nameNode.path());
- }
- public boolean containsNameNode(String name) {
- return this.nameNode(name) != null;
- }
- public TestNode nameNode(String name) {
- for (Iterator<TestNode> stream = this.nameNodes(); stream.hasNext(); ) {
- TestNode node = stream.next();
- if (node.getText().equals(name)) {
- return node;
- }
- }
- return null;
- }
- public TestNode getRootDescriptionNode() {
- return this.rootDescriptionNode;
- }
- public Iterator<TestNode> descriptionNodes() {
- return new TreeIterator<TestNode>(this.rootDescriptionNode) {
- @Override
- public Iterator<TestNode> children(TestNode next) {
- return next.children();
- }
- };
- }
- public Iterator<TestNode[]> descriptionPaths() {
- return new TransformationIterator<TestNode, TestNode[]>(this.descriptionNodes()) {
- @Override
- protected TestNode[] transform(TestNode next) {
- return next.path();
- }
- };
- }
- public TestNode addDescription(TestNode parent, String description) {
- TestNode child = new TestNode(description);
- parent.addChild(child);
- this.fireNodeAdded(DESCRIPTIONS_TREE, child.path());
- return child;
- }
- public void removeDescriptionNode(TestNode descriptionNode) {
- descriptionNode.getParent().removeChild(descriptionNode);
- this.fireNodeRemoved(DESCRIPTIONS_TREE, descriptionNode.path());
- }
- public boolean containsDescriptionNode(String name) {
- for (Iterator<TestNode> stream = this.descriptionNodes(); stream.hasNext(); ) {
- TestNode node = stream.next();
- if (node.getText().equals(name)) {
- return true;
- }
- }
- return false;
- }
- }
-
- private class TestNode {
- private final String text;
- private TestNode parent;
- private final Collection<TestNode> children;
-
- public TestNode(String text) {
- this.text = text;
- this.children = new HashBag<TestNode>();
- }
- public String getText() {
- return this.text;
- }
- public TestNode getParent() {
- return this.parent;
- }
- private void setParent(TestNode parent) {
- this.parent = parent;
- }
- public Iterator<TestNode> children() {
- return new ReadOnlyIterator<TestNode>(this.children);
- }
- public void addChild(TestNode child) {
- this.children.add(child);
- child.setParent(this);
- }
- public void removeChild(TestNode child) {
- this.children.remove(child);
- }
- public TestNode[] path() {
- return CollectionTools.reverseList(this.buildAntiPath()).toArray(new TestNode[0]);
- }
- private Iterator<TestNode> buildAntiPath() {
- return new ChainIterator<TestNode>(this) {
- @Override
- protected TestNode nextLink(TestNode currentLink) {
- return currentLink.getParent();
- }
- };
- }
- @Override
- public String toString() {
- return "TestNode(" + this.text + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
deleted file mode 100644
index 1f7bab6d37..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueCollectionAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValueCollectionAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueCollectionAdapter<Junk> junkHolder2;
-
-
- public ValueCollectionAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueCollectionAdapter<Junk>(this.junkHolder, Junk.STUFF_COLLECTION);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testCollectionAdd() {
- LocalListener l = new LocalListener(this.junkHolder2);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.addStuff("bar");
- assertTrue(l.eventReceived());
- }
-
- public void testCollectionRemove() {
- LocalListener l = new LocalListener(this.junkHolder2);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.removeStuff("foo");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
-
- private class Junk extends AbstractModel {
- private Collection<String> stuff;
- public static final String STUFF_COLLECTION = "stuff";
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java
deleted file mode 100644
index 31050d8c27..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValueListAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueListAdapter<Junk> junkHolder2;
-
-
-
- public ValueListAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueListAdapter<Junk>(this.junkHolder, Junk.STUFF_LIST);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testListAdd() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.addStuff("bar");
- assertTrue(l.eventReceived());
- }
-
- public void testListRemove() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.removeStuff("foo");
- assertTrue(l.eventReceived());
- }
-
- public void testListReplace() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.replaceStuff("foo", "bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private List<String> stuff;
- public static final String STUFF_LIST = "stuff";
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToList(stuffItem, this.stuff, STUFF_LIST);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromList(stuffItem, this.stuff, STUFF_LIST);
- }
-
- public void replaceStuff(String oldStuffItem, String newStuffItem) {
- this.replaceItemInList(oldStuffItem, newStuffItem, this.stuff, STUFF_LIST);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
deleted file mode 100644
index 62832c8a84..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValuePropertyAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValuePropertyAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValuePropertyAdapter<Junk> junkHolder2;
-
-
- public ValuePropertyAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValuePropertyAdapter<Junk>(this.junkHolder, Junk.NAME_PROPERTY);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testChangeProperty() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Junk(String name) {
- this.name = name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java
deleted file mode 100644
index 71dfee9e0f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueStateAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValueStateAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueStateAdapter<Junk> junkHolder2;
-
-
- public ValueStateAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueStateAdapter<Junk>(this.junkHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyStateChangeListeners());
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyStateChangeListeners());
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyStateChangeListeners());
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testChangeState() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.getAspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Junk(String name) {
- this.name = name;
- }
-
- public void setName(String name) {
- this.name = name;
- this.fireStateChanged();
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
deleted file mode 100644
index 043da07fbf..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValuePrefsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValuePrefsTests.class.getPackage().getName());
-
- suite.addTestSuite(PreferencesCollectionValueModelTests.class);
- suite.addTestSuite(PreferencePropertyValueModelTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValuePrefsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
deleted file mode 100644
index 95f9cae3d7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import java.util.prefs.NodeChangeEvent;
-import java.util.prefs.NodeChangeListener;
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-public class PreferencePropertyValueModelTests extends PreferencesTestCase {
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencePropertyValueModel<String> preferenceAdapter;
- PropertyChangeEvent event;
- PropertyChangeListener listener;
- boolean listenerRemoved = false;
- PreferenceChangeEvent preferenceEvent;
- private static final String KEY_NAME = "foo";
- private static final String STRING_VALUE = "original string value";
-
- public PreferencePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testNode.put(KEY_NAME, STRING_VALUE);
-
- this.nodeHolder = new SimplePropertyValueModel<Preferences>(this.testNode);
- this.preferenceAdapter = new PreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME);
- this.listener = this.buildValueChangeListener();
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.event = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- private PropertyChangeListener buildValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (PreferencePropertyValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- public void testSubjectHolder() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- String ANOTHER_STRING_VALUE = "some other value";
- Preferences anotherNode = this.classNode.node("another test node");
- anotherNode.put(KEY_NAME, ANOTHER_STRING_VALUE);
-
- this.nodeHolder.setValue(anotherNode);
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- assertEquals(ANOTHER_STRING_VALUE, this.preferenceAdapter.getValue());
-
- this.event = null;
- this.nodeHolder.setValue(null);
- this.verifyEvent(ANOTHER_STRING_VALUE, null);
- assertNull(this.preferenceAdapter.getValue());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testPreferenceChange() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- this.testNode.put(KEY_NAME, STRING_VALUE + STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyEvent(STRING_VALUE, STRING_VALUE + STRING_VALUE);
- assertEquals(STRING_VALUE + STRING_VALUE, this.preferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- this.verifyEvent(STRING_VALUE + STRING_VALUE, null);
- assertNull(this.preferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testValue() throws Exception {
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, "<missing preference>"));
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testSetValue() throws Exception {
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
- assertEquals(ANOTHER_STRING_VALUE, this.preferenceAdapter.getValue());
- assertEquals(ANOTHER_STRING_VALUE, this.testNode.get(KEY_NAME, "<missing preference>"));
- }
-
- public void testHasListeners() throws Exception {
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyChangeListener listener2 = this.buildValueChangeListener();
- this.preferenceAdapter.addPropertyChangeListener(listener2);
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removePropertyChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testRemoveAndReAddPreference() throws Exception {
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- // remove the preference entirely...
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.testNode.get(KEY_NAME, null));
- this.verifyEvent(STRING_VALUE, null);
- assertNull(this.preferenceAdapter.getValue());
-
- // ...then re-add it with the same key
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- // rebuild the adapter with a default value
- String DEFAULT_VALUE = "default value";
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.preferenceAdapter = new PreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME, DEFAULT_VALUE);
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- // remove the preference entirely...
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.testNode.get(KEY_NAME, null));
- this.verifyEvent(STRING_VALUE, DEFAULT_VALUE);
- assertEquals(DEFAULT_VALUE, this.preferenceAdapter.getValue());
-
- // ...then re-add it with the same key
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- this.verifyEvent(DEFAULT_VALUE, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testUnsynchronizedValue() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- // remove the this.listener so the adapter no longer listens to the preference
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- this.testNode.put(KEY_NAME, STRING_VALUE + STRING_VALUE);
- this.waitForEventQueueToClear();
- // no this.event should have been fired...
- assertNull(this.event);
- // ...and the adapter's value should be null
- assertNull(this.preferenceAdapter.getValue());
-
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.event);
- assertNull(this.preferenceAdapter.getValue());
-
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertNull(this.event);
- assertNull(this.preferenceAdapter.getValue());
-
- // add the this.listener so the adapter synchs
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testIntegerPreference() throws Exception {
- // stop listening to the node and convert it to an integer
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- PreferencePropertyValueModel<Integer> integerPreferenceAdapter = new PreferencePropertyValueModel<Integer>(this.nodeHolder, KEY_NAME);
- this.testNode.putInt(KEY_NAME, 123);
- integerPreferenceAdapter = PreferencePropertyValueModel.forInteger(this.testNode, KEY_NAME, 0);
- integerPreferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertEquals(new Integer(123), integerPreferenceAdapter.getValue());
- assertNull(this.event);
-
- this.testNode.putInt(KEY_NAME, 246);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(123), new Integer(246));
- assertEquals(new Integer(246), integerPreferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(246), new Integer(0));
- assertEquals(new Integer(0), integerPreferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.putInt(KEY_NAME, 123);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(0), new Integer(123));
- assertEquals(new Integer(123), integerPreferenceAdapter.getValue());
- }
-
- /**
- * test a situation where
- * - we are listening to the node when it gets removed from the preferences "repository"
- * - we get notification that it has been removed
- * - we try to remove our this.listener
- * - the node will throw an IllegalStateException - the adapter should handle it OK...
- */
- public void testRemoveNode() throws Exception {
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- Preferences parent = this.testNode.parent();
- parent.addNodeChangeListener(this.buildParentNodeChangeListener());
- this.testNode.removeNode();
- this.testNode.flush(); // this seems to be required for the this.event to trigger...
- this.waitForEventQueueToClear();
-
- assertTrue(this.listenerRemoved);
- assertTrue(this.preferenceAdapter.hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- private NodeChangeListener buildParentNodeChangeListener() {
- return new NodeChangeListener() {
- public void childAdded(NodeChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- public void childRemoved(NodeChangeEvent e) {
- if (e.getChild() == PreferencePropertyValueModelTests.this.testNode) {
- PreferencePropertyValueModelTests.this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, PreferencePropertyValueModelTests.this.listener);
- // this line of code will not execute if the line above triggers an exception
- PreferencePropertyValueModelTests.this.listenerRemoved = true;
- }
- }
- };
- }
-
- public void testSetSameValue() {
- assertNull(this.event);
- assertNull(this.preferenceEvent);
- this.testNode.addPreferenceChangeListener(this.buildPreferenceChangeListener());
-
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
-
- // now set to *same* value - nothing should happen...
- this.event = null;
- this.preferenceEvent = null;
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- assertNull(this.event);
- assertNull(this.preferenceEvent);
- }
-
- public void testSetSameValueForcePassThrough() throws Exception {
- assertNull(this.event);
- assertNull(this.preferenceEvent);
-
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.preferenceAdapter = new AlwaysUpdatePreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME);
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- this.testNode.addPreferenceChangeListener(this.buildPreferenceChangeListener());
-
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
-
- // now set to *same* value - only one this.event should fire
- this.event = null;
- this.preferenceEvent = null;
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- assertNull(this.event);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
- assertNull(this.event);
- }
-
- private PreferenceChangeListener buildPreferenceChangeListener() {
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent evt) {
- PreferencePropertyValueModelTests.this.preferenceEvent = evt;
- }
- };
- }
-
- private void verifyEvent(Model source, Object oldValue, Object newValue) {
- assertNotNull(this.event);
- assertEquals(source, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.getPropertyName());
- assertEquals(oldValue, this.event.getOldValue());
- assertEquals(newValue, this.event.getNewValue());
- }
-
- private void verifyEvent(Object oldValue, Object newValue) {
- this.verifyEvent(this.preferenceAdapter, oldValue, newValue);
- }
-
- private void verifyPreferenceEvent(Object newValue) {
- assertNotNull(this.preferenceEvent);
- assertEquals(this.testNode, this.preferenceEvent.getSource());
- assertEquals(KEY_NAME, this.preferenceEvent.getKey());
- assertEquals(newValue, this.preferenceEvent.getNewValue());
- assertEquals(newValue, this.testNode.get(KEY_NAME, "<missing preference>"));
- }
-
- private boolean nodeHasAnyPrefListeners(Preferences node) throws Exception {
- PreferenceChangeListener[] prefListeners = (PreferenceChangeListener[]) ClassTools.fieldValue(node, "prefListeners");
- return prefListeners.length > 0;
- }
-
-
- /**
- * Use this adapter to test out always passing through the new value
- * to the preference.
- */
- private class AlwaysUpdatePreferencePropertyValueModel<P> extends PreferencePropertyValueModel<P> {
-
- AlwaysUpdatePreferencePropertyValueModel(PropertyValueModel<Preferences> preferencesHolder, String key) {
- super(preferencesHolder, key);
- }
-
- @Override
- protected boolean shouldSetPreference(Object oldValue, Object newValue) {
- return true;
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
deleted file mode 100644
index f6e4a59a7b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.prefs.NodeChangeEvent;
-import java.util.prefs.NodeChangeListener;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencesCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-public class PreferencesCollectionValueModelTests extends PreferencesTestCase {
- private Map<String, String> expectedValues;
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencesCollectionValueModel<String> preferencesAdapter;
- CollectionChangeEvent event;
- CollectionChangeListener listener;
- private PropertyChangeListener itemListener;
- boolean listenerRemoved = false;
- private static final String KEY_NAME_1 = "foo 1";
- private static final String KEY_NAME_2 = "foo 2";
- private static final String KEY_NAME_3 = "foo 3";
- private static final String STRING_VALUE_1 = "original string value 1";
- private static final String STRING_VALUE_2 = "original string value 2";
- private static final String STRING_VALUE_3 = "original string value 3";
-
- public PreferencesCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.expectedValues = new HashMap<String, String>();
- this.testNode.put(KEY_NAME_1, STRING_VALUE_1); this.expectedValues.put(KEY_NAME_1, STRING_VALUE_1);
- this.testNode.put(KEY_NAME_2, STRING_VALUE_2); this.expectedValues.put(KEY_NAME_2, STRING_VALUE_2);
- this.testNode.put(KEY_NAME_3, STRING_VALUE_3); this.expectedValues.put(KEY_NAME_3, STRING_VALUE_3);
-
- this.nodeHolder = new SimplePropertyValueModel<Preferences>(this.testNode);
- this.preferencesAdapter = new PreferencesCollectionValueModel<String>(this.nodeHolder);
- this.listener = this.buildCollectionChangeListener();
- this.itemListener = this.buildItemListener();
- this.preferencesAdapter.addCollectionChangeListener(CollectionValueModel.VALUES, this.listener);
- this.event = null;
- }
-
- private CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void collectionChanged(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void collectionCleared(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void itemsAdded(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- private void logEvent(CollectionChangeEvent e) {
- if (PreferencesCollectionValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencesCollectionValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildItemListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- };
- }
-
- public void testSubjectHolder() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String ANOTHER_KEY_NAME_1 = "another key 1";
- String ANOTHER_KEY_NAME_2 = "another key 2";
- String ANOTHER_KEY_NAME_3 = "another key 3";
- String ANOTHER_STRING_VALUE_1 = "another string value 1";
- String ANOTHER_STRING_VALUE_2 = "another string value 2";
- String ANOTHER_STRING_VALUE_3 = "another string value 3";
- Preferences anotherNode = this.classNode.node("another test node");
- this.expectedValues.clear();
- anotherNode.put(ANOTHER_KEY_NAME_1, ANOTHER_STRING_VALUE_1); this.expectedValues.put(ANOTHER_KEY_NAME_1, ANOTHER_STRING_VALUE_1);
- anotherNode.put(ANOTHER_KEY_NAME_2, ANOTHER_STRING_VALUE_2); this.expectedValues.put(ANOTHER_KEY_NAME_2, ANOTHER_STRING_VALUE_2);
- anotherNode.put(ANOTHER_KEY_NAME_3, ANOTHER_STRING_VALUE_3); this.expectedValues.put(ANOTHER_KEY_NAME_3, ANOTHER_STRING_VALUE_3);
-
- this.nodeHolder.setValue(anotherNode);
- // collectionChanged does not pass any items in the this.event
- this.verifyEvent(Collections.<String, String>emptyMap());
- this.verifyAdapter(this.preferencesAdapter);
-
- this.event = null;
- this.expectedValues.clear();
- this.nodeHolder.setValue(null);
- this.verifyEvent(this.expectedValues);
- assertFalse(this.preferencesAdapter.iterator().hasNext());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent(Collections.<String, String>emptyMap());
- this.expectedValues.clear();
- this.expectedValues.put(KEY_NAME_1, STRING_VALUE_1);
- this.expectedValues.put(KEY_NAME_2, STRING_VALUE_2);
- this.expectedValues.put(KEY_NAME_3, STRING_VALUE_3);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testAddPreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String ANOTHER_KEY_NAME = "another key";
- String ANOTHER_STRING_VALUE = "another string value";
- this.testNode.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- Map<String, String> expectedItems = new HashMap<String, String>();
- expectedItems.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.verifyEvent(expectedItems);
- this.expectedValues.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testRemovePreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- this.testNode.remove(KEY_NAME_2);
- this.waitForEventQueueToClear();
-
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.getCollectionName());
- assertEquals(1, this.event.itemsSize());
- @SuppressWarnings("unchecked")
- String key = ((PreferencePropertyValueModel<String>) this.event.items().next()).getKey();
- assertEquals(KEY_NAME_2, key);
-
- this.expectedValues.remove(KEY_NAME_2);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testChangePreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String DIFFERENT = "something completely different";
- this.testNode.put(KEY_NAME_2, DIFFERENT);
- this.waitForEventQueueToClear();
-
- assertNull(this.event);
-
- this.expectedValues.put(KEY_NAME_2, DIFFERENT);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testValues() throws Exception {
- this.verifyNode(this.testNode);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- /**
- * test a situation where
- * - we are listening to the node when it gets removed from the preferences "repository"
- * - we get notification that it has been removed
- * - we try to remove our this.listener
- * - the node will throw an IllegalStateException - the adapter should handle it OK...
- */
- public void testRemoveNode() throws Exception {
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- Preferences parent = this.testNode.parent();
- parent.addNodeChangeListener(this.buildParentNodeChangeListener());
- this.testNode.removeNode();
- this.testNode.flush(); // this seems to be required for the this.event to trigger...
- this.waitForEventQueueToClear();
-
- assertTrue(this.listenerRemoved);
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private NodeChangeListener buildParentNodeChangeListener() {
- return new NodeChangeListener() {
- public void childAdded(NodeChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- public void childRemoved(NodeChangeEvent e) {
- if (e.getChild() == PreferencesCollectionValueModelTests.this.testNode) {
- PreferencesCollectionValueModelTests.this.preferencesAdapter.removeCollectionChangeListener(CollectionValueModel.VALUES, PreferencesCollectionValueModelTests.this.listener);
- // this line of code will not execute if the line above triggers an exception
- PreferencesCollectionValueModelTests.this.listenerRemoved = true;
- }
- }
- };
- }
-
- public void testHasListeners() throws Exception {
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeCollectionChangeListener(CollectionValueModel.VALUES, this.listener);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- CollectionChangeListener listener2 = this.buildCollectionChangeListener();
- this.preferencesAdapter.addCollectionChangeListener(listener2);
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeCollectionChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private void verifyEvent(Map<String, String> items) {
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.getCollectionName());
- assertEquals(items.size(), this.event.itemsSize());
- @SuppressWarnings("unchecked")
- Iterator<PreferencePropertyValueModel<String>> eventItems = (Iterator<PreferencePropertyValueModel<String>>) this.event.items();
- this.verifyItems(items, eventItems);
- }
-
- private void verifyNode(Preferences node) throws Exception {
- String[] keys = node.keys();
- assertEquals(this.expectedValues.size(), keys.length);
- for (int i = 0; i < keys.length; i++) {
- assertEquals(this.expectedValues.get(keys[i]), node.get(keys[i], "<missing preference>"));
- }
- }
-
- private void verifyAdapter(PreferencesCollectionValueModel<String> cvm) {
- assertEquals(this.expectedValues.size(), cvm.size());
- this.verifyItems(this.expectedValues, cvm.iterator());
- }
-
- private void verifyItems(Map<String, String> expected, Iterator<PreferencePropertyValueModel<String>> stream) {
- while (stream.hasNext()) {
- PreferencePropertyValueModel<String> model = stream.next();
- model.addPropertyChangeListener(PropertyValueModel.VALUE, this.itemListener);
- assertEquals(expected.get(model.getKey()), model.getValue());
- model.removePropertyChangeListener(PropertyValueModel.VALUE, this.itemListener);
- }
- }
-
- private boolean nodeHasAnyPrefListeners(Preferences node) throws Exception {
- PreferenceChangeListener[] prefListeners = (PreferenceChangeListener[]) ClassTools.fieldValue(node, "prefListeners");
- return prefListeners.length > 0;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
deleted file mode 100644
index bca284a8fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import java.util.EventObject;
-import java.util.List;
-import java.util.prefs.AbstractPreferences;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-/**
- * set up and tear down a test node for any subclass that
- * needs to test preferences-related stuff
- */
-public abstract class PreferencesTestCase extends TestCase {
- protected Preferences classNode;
- public Preferences testNode;
- protected static final String TEST_NODE_NAME = "test node";
-
- public PreferencesTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Preferences packageNode = Preferences.userNodeForPackage(this.getClass());
- this.classNode = packageNode.node(ClassTools.shortClassNameForObject(this));
- // clean out any leftover crap...
- if ((this.classNode.keys().length > 0) || (this.classNode.childrenNames().length > 0)) {
- this.classNode.removeNode();
- // ...and re-create the node
- this.classNode = packageNode.node(ClassTools.shortClassNameForObject(this));
- }
- this.testNode = this.classNode.node(TEST_NODE_NAME);
- }
-
- @Override
- protected void tearDown() throws Exception {
- // wait for all the events to be delivered before tearing down
- this.waitForEventQueueToClear();
- Preferences node = this.classNode.parent();
- this.classNode.removeNode();
- while (this.nodeIsVestigial(node)) {
- Preferences parent = node.parent();
- node.removeNode();
- node = parent;
- }
- TestTools.clear(this);
- super.tearDown();
- }
-
- private boolean nodeIsVestigial(Preferences node) throws Exception {
- return (node != null)
- && (node.keys().length == 0)
- && (node.childrenNames().length == 0)
- && (node != Preferences.userRoot());
- }
-
- protected void waitForEventQueueToClear() {
- try {
- while ( ! this.preferencesEventQueue().isEmpty()) {
- Thread.sleep(100);
- }
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @SuppressWarnings("unchecked")
- private List<EventObject> preferencesEventQueue() {
- return (List<EventObject>) ClassTools.staticFieldValue(AbstractPreferences.class, "eventQueue");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
deleted file mode 100644
index ec19fcee7c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.ButtonModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CheckBoxModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Boolean> booleanHolder;
- private ButtonModel buttonModelAdapter;
- boolean eventFired;
-
- public CheckBoxModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.booleanHolder = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.buttonModelAdapter = new CheckBoxModelAdapter(this.booleanHolder) {
- @Override
- protected PropertyChangeListener buildBooleanChangeListener() {
- return this.buildBooleanChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetSelected() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- this.buttonModelAdapter.setSelected(false);
- assertTrue(this.eventFired);
- assertEquals(Boolean.FALSE, this.booleanHolder.getValue());
- }
-
- public void testSetValue() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- assertTrue(this.buttonModelAdapter.isSelected());
- this.booleanHolder.setValue(Boolean.FALSE);
- assertTrue(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- assertTrue(this.buttonModelAdapter.isSelected());
- this.booleanHolder.setValue(null);
- assertTrue(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
-
- this.eventFired = false;
- this.booleanHolder.setValue(Boolean.FALSE);
- assertFalse(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Boolean> localBooleanHolder = (SimplePropertyValueModel<Boolean>) this.booleanHolder;
- assertFalse(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.buttonModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.buttonModelAdapter.addChangeListener(listener);
- assertTrue(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.buttonModelAdapter);
-
- this.buttonModelAdapter.removeChangeListener(listener);
- assertFalse(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.buttonModelAdapter);
- }
-
- private void verifyHasNoListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertFalse(listenerList.getListenerList().length == 0);
- }
-
-
- // ********** member class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index d41842e632..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of check boxes.
- */
-public class CheckBoxModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Boolean> flag1Holder;
- private WritablePropertyValueModel<Boolean> flag2Holder;
- private WritablePropertyValueModel<Boolean> notFlag2Holder;
- private ButtonModel flag1ButtonModel;
- private ButtonModel flag2ButtonModel;
- private ButtonModel notFlag2ButtonModel;
-
- public static void main(String[] args) throws Exception {
- new CheckBoxModelAdapterUITest().exec(args);
- }
-
- private CheckBoxModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel(true, true);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag1ButtonModel = this.buildCheckBoxModelAdapter(this.flag1Holder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.flag2ButtonModel = this.buildCheckBoxModelAdapter(this.flag2Holder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- this.notFlag2ButtonModel = this.buildCheckBoxModelAdapter(this.notFlag2Holder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag1());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNotFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value.booleanValue());
- }
- };
- }
-
- private ButtonModel buildCheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- return new CheckBoxModelAdapter(booleanHolder);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildCheckBoxPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildCheckBoxPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildFlag1CheckBox());
- taskListPanel.add(this.buildFlag2CheckBox());
- taskListPanel.add(this.buildNotFlag2CheckBox());
- taskListPanel.add(this.buildUnattachedCheckBox());
- return taskListPanel;
- }
-
- private JCheckBox buildFlag1CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("flag 1");
- checkBox.setModel(this.flag1ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildFlag2CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("flag 2");
- checkBox.setModel(this.flag2ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildNotFlag2CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("not flag 2");
- checkBox.setModel(this.notFlag2ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildUnattachedCheckBox() {
- JCheckBox checkBox = new JCheckBox("unattached");
- checkBox.getModel().addItemListener(this.buildUnattachedItemListener());
- return checkBox;
- }
-
- private ItemListener buildUnattachedItemListener() {
- return new ItemListener() {
- public void itemStateChanged(ItemEvent e) {
- System.out.println("unattached state changed: " + e);
- }
- };
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildFlipFlag1Button());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildFlipFlag1Button() {
- return new JButton(this.buildFlipFlag1Action());
- }
-
- private Action buildFlipFlag1Action() {
- Action action = new AbstractAction("flip flag 1") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.flipFlag1();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void flipFlag1() {
- this.testModel.setFlag1( ! this.testModel.isFlag1());
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(boolean flag1, boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = ! flag2;
- }
- public boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(boolean flag1) {
- boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(boolean flag2) {
- boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = ! flag2;
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(boolean notFlag2) {
- this.setFlag2( ! notFlag2);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
deleted file mode 100644
index 82a1dc622d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.ComboBoxModel;
-import javax.swing.ListModel;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.CoordinatedList;
-
-import junit.framework.TestCase;
-
-public class ComboBoxModelAdapterTests extends TestCase {
-
- public ComboBoxModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- // nothing yet...
- }
-
- @Override
- protected void tearDown() throws Exception {
- // nothing yet...
- super.tearDown();
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Displayable> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- SimplePropertyValueModel<Object> selectionHolder = new SimplePropertyValueModel<Object>(listHolder.iterator().next());
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- ComboBoxModel comboBoxModel = new ComboBoxModelAdapter(listHolder, selectionHolder);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(comboBoxModel);
-
- CoordinatedList<Displayable> synchList = new CoordinatedList<Displayable>(comboBoxModel);
- PropertyChangeListener selectionListener = this.buildSelectionListener();
- selectionHolder.addPropertyChangeListener(PropertyValueModel.VALUE, selectionListener);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(comboBoxModel);
-
- comboBoxModel.removeListDataListener(synchList);
- selectionHolder.removePropertyChangeListener(PropertyValueModel.VALUE, selectionListener);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(comboBoxModel);
- }
-
- private PropertyChangeListener buildSelectionListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent evt) {
- // do nothing...
- }
- };
- }
-
- private void verifyHasNoListeners(ListModel listModel) throws Exception {
- boolean hasNoListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasListDataListeners")).booleanValue();
- assertTrue(hasListeners);
- }
-
- private SimpleListValueModel<Displayable> buildListHolder() {
- return new SimpleListValueModel<Displayable>(this.buildList());
- }
-
- private List<Displayable> buildList() {
- List<Displayable> list = new ArrayList<Displayable>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Displayable> c) {
- c.add(new SimpleDisplayable("foo"));
- c.add(new SimpleDisplayable("bar"));
- c.add(new SimpleDisplayable("baz"));
- c.add(new SimpleDisplayable("joo"));
- c.add(new SimpleDisplayable("jar"));
- c.add(new SimpleDisplayable("jaz"));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
deleted file mode 100644
index 91d7713c4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.ListCellRenderer;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.FilteringListBrowser;
-import org.eclipse.jpt.utility.internal.swing.ListChooser;
-import org.eclipse.jpt.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * Play around with a set of combo-boxes.
- *
- * DefaultLongListBrowserDialogUITest subclasses this class; so be
- * careful when making changes.
- */
-public class ComboBoxModelAdapterUITest {
-
- protected JFrame window;
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Object> colorHolder;
- private SimpleListValueModel<String> colorListHolder;
- protected ComboBoxModel colorComboBoxModel;
- private int nextColorNumber = 0;
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest().exec(args);
- }
-
- protected ComboBoxModelAdapterUITest() {
- super();
- }
-
- protected void exec(String[] args) throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); // Metal LAF
-// UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel.class.getName());
-// UIManager.setLookAndFeel(com.sun.java.swing.plaf.motif.MotifLookAndFeel.class.getName());
-// UIManager.setLookAndFeel(oracle.bali.ewt.olaf.OracleLookAndFeel.class.getName());
- this.testModel = this.buildTestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.colorHolder = this.buildColorHolder(this.testModelHolder);
- this.colorListHolder = this.buildColorListHolder();
- this.colorComboBoxModel = this.buildComboBoxModelAdapter(this.colorListHolder, this.colorHolder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildColorHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.COLOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setColor((String) value);
- }
- };
- }
-
- protected TestModel buildTestModel() {
- return new TestModel();
- }
-
- private SimpleListValueModel<String> buildColorListHolder() {
- return new SimpleListValueModel<String>(TestModel.validColors());
-// return new AbstractReadOnlyListValueModel() {
-// public Object value() {
-// return new ArrayListIterator(TestModel.VALID_COLORS);
-// }
-// public int size() {
-// return TestModel.VALID_COLORS.length;
-// }
-// };
- }
-
- protected ListValueModel<String> uiColorListHolder() {
- return this.colorListHolder;
- }
-
- private ComboBoxModel buildComboBoxModelAdapter(ListValueModel<String> listHolder, WritablePropertyValueModel<Object> selectionHolder) {
- return new ComboBoxModelAdapter(listHolder, selectionHolder);
- }
-
- private void openWindow() {
- this.window = new JFrame(ClassTools.shortNameFor(this.getClass()));
- this.window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- this.window.addWindowListener(this.buildWindowListener());
- this.window.getContentPane().add(this.buildMainPanel(), "Center");
- this.window.setLocation(300, 300);
- this.window.setSize(400, 150);
- this.window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildComboBoxPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- protected JPanel buildComboBoxPanel() {
- JPanel panel = new JPanel(new GridLayout(1, 0));
- panel.add(this.buildComboBox());
- panel.add(this.buildComboBox());
- panel.add(this.buildListChooser1());
- panel.add(this.buildListChooser2());
- return panel;
- }
-
- private JComboBox buildComboBox() {
- JComboBox comboBox = new JComboBox(this.colorComboBoxModel);
- comboBox.setRenderer(this.buildComboBoxRenderer());
- return comboBox;
- }
-
- protected ListCellRenderer buildComboBoxRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- protected String buildText(Object value) {
- return super.buildText(value);
- }
- };
- }
-
- private ListChooser buildListChooser1() {
- return new LocalListChooser1(this.colorComboBoxModel);
- }
-
- private ListChooser buildListChooser2() {
- return new LocalListChooser2(this.colorComboBoxModel);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(2, 0));
- controlPanel.add(this.buildResetColorButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- controlPanel.add(this.buildAddTenButton());
- controlPanel.add(this.buildRemoveTenButton());
- return controlPanel;
- }
-
- // ********** reset color button **********
- private JButton buildResetColorButton() {
- return new JButton(this.buildResetColorAction());
- }
-
- private Action buildResetColorAction() {
- Action action = new AbstractAction("reset color") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.resetColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetColor() {
- this.testModel.setColor(TestModel.DEFAULT_COLOR);
- }
-
- // ********** clear model button **********
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- // ********** restore model button **********
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- // ********** print model button **********
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println(this.testModel);
- }
-
- // ********** add 20 button **********
- private JButton buildAddTenButton() {
- return new JButton(this.buildAddTenAction());
- }
-
- private Action buildAddTenAction() {
- Action action = new AbstractAction("add 20") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.addTen();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addTen() {
- for (int i = this.nextColorNumber; i < this.nextColorNumber + 20; i++) {
- this.colorListHolder.add(this.colorListHolder.size(), "color" + i);
- }
- this.nextColorNumber += 20;
- }
-
- // ********** remove 20 button **********
- private JButton buildRemoveTenButton() {
- return new JButton(this.buildRemoveTenAction());
- }
-
- private Action buildRemoveTenAction() {
- Action action = new AbstractAction("remove 20") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.removeTen();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void removeTen() {
- for (int i = 0; i < 20; i++) {
- if (this.colorListHolder.size() > 0) {
- this.colorListHolder.remove(this.colorListHolder.size() - 1);
- }
- }
- }
-
-
- protected static class TestModel extends AbstractModel {
- private String color;
- public static final String COLOR_PROPERTY = "color";
- public static final String RED = "red";
- public static final String ORANGE = "orange";
- public static final String YELLOW = "yellow";
- public static final String GREEN = "green";
- public static final String BLUE = "blue";
- public static final String INDIGO = "indigo";
- public static final String VIOLET = "violet";
- public static final String DEFAULT_COLOR = RED;
- public static List<String> validColors;
- public static final String[] DEFAULT_VALID_COLORS = {
- RED,
- ORANGE,
- YELLOW,
- GREEN,
- BLUE,
- INDIGO,
- VIOLET
- };
-
- public static List<String> validColors() {
- if (validColors == null) {
- validColors = buildDefaultValidColors();
- }
- return validColors;
- }
- public static List<String> buildDefaultValidColors() {
- List<String> result = new ArrayList<String>();
- CollectionTools.addAll(result, DEFAULT_VALID_COLORS);
- return result;
- }
-
- public TestModel() {
- this(DEFAULT_COLOR);
- }
- public TestModel(String color) {
- this.color = color;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor(String color) {
- this.checkColor(color);
- Object old = this.color;
- this.color = color;
- this.firePropertyChanged(COLOR_PROPERTY, old, color);
- }
- public void checkColor(String c) {
- if ( ! validColors().contains(c)) {
- throw new IllegalArgumentException(c);
- }
- }
- @Override
- public String toString() {
- return "TestModel(" + this.color + ")";
- }
- }
-
-
- private class LocalListChooser1 extends ListChooser {
- public LocalListChooser1(ComboBoxModel model) {
- super(model);
- }
- }
-
-
- private class LocalListChooser2 extends ListChooser {
- public LocalListChooser2(ComboBoxModel model) {
- super(model);
- }
- @Override
- protected ListBrowser buildBrowser() {
- return new FilteringListBrowser<String>();
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
deleted file mode 100644
index 1cd1c04947..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.ListCellRenderer;
-
-import org.eclipse.jpt.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- *
- */
-public class ComboBoxModelAdapterUITest2 extends ComboBoxModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest2().exec(args);
- }
-
- public ComboBoxModelAdapterUITest2() {
- super();
- }
-
- /**
- * use a different model that allows the color to be set to null
- */
- @Override
- protected TestModel buildTestModel() {
- return new TestModel2();
- }
-
- /**
- * add a null to the front of the list
- */
- @Override
- protected ListValueModel<String> uiColorListHolder() {
- // the default is to prepend the wrapped list with a null item
- return new ExtendedListValueModelWrapper<String>(super.uiColorListHolder());
- }
-
- /**
- * convert null to some text
- */
- @Override
- protected ListCellRenderer buildComboBoxRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- protected String buildText(Object value) {
- return (value == null) ? "<none selected>" : super.buildText(value);
- }
- };
- }
-
-
- protected static class TestModel2 extends TestModel {
- /**
- * null is OK here
- */
- @Override
- public void checkColor(String color) {
- if (color == null) {
- return;
- }
- super.checkColor(color);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
deleted file mode 100644
index 229f5ef63a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.Date;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class DateSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public DateSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(new Date());
- this.spinnerModelAdapter = new DateSpinnerModelAdapter(this.valueHolder) {
- @Override
- protected PropertyChangeListener buildDateChangeListener() {
- return this.buildDateChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- Date newDate = new Date();
- newDate.setTime(777777);
- this.spinnerModelAdapter.setValue(newDate);
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.valueHolder.getValue()).getTime());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- }
-
- public void testDefaultValue() throws Exception {
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertFalse(((Date) this.spinnerModelAdapter.getValue()).getTime() == 777777);
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((DateSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((DateSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
- public void testNullInitialValue() {
- Date today = new Date();
- this.valueHolder = new SimplePropertyValueModel<Object>();
- this.spinnerModelAdapter = new DateSpinnerModelAdapter(this.valueHolder, today) {
- @Override
- protected PropertyChangeListener buildDateChangeListener() {
- return this.buildDateChangeListener_();
- }
- };
-
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(today, this.spinnerModelAdapter.getValue());
-
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
-
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- }
-
-
- // ********** inner class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
deleted file mode 100644
index cafe3aa820..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.DocumentEvent.EventType;
-import javax.swing.text.Document;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class DocumentAdapterTests extends TestCase {
- private WritablePropertyValueModel<String> stringHolder;
- Document documentAdapter;
- boolean eventFired;
-
- public DocumentAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.stringHolder = new SimplePropertyValueModel<String>("0123456789");
- this.documentAdapter = new DocumentAdapter(this.stringHolder) {
- @Override
- protected PropertyChangeListener buildStringListener() {
- return this.buildStringListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testRemove() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void removeUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.REMOVE, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the removal of "23456"
- assertEquals(2, e.getOffset());
- assertEquals(5, e.getLength());
- }
- });
- this.documentAdapter.remove(2, 5);
- assertTrue(this.eventFired);
- assertEquals("01789", this.stringHolder.getValue());
- }
-
- public void testInsert() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.INSERT, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the insert of "xxxxxx"
- assertEquals(2, e.getOffset());
- assertEquals(5, e.getLength());
- }
- });
- this.documentAdapter.insertString(2, "xxxxx", null);
- assertTrue(this.eventFired);
- assertEquals("01xxxxx23456789", this.stringHolder.getValue());
- }
-
- public void testSetValue() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.INSERT, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the insert of "foo"
- assertEquals(0, e.getOffset());
- assertEquals(3, e.getLength());
- }
- @Override
- public void removeUpdate(DocumentEvent e) {
- assertEquals(EventType.REMOVE, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the removal of "0123456789"
- assertEquals(0, e.getOffset());
- assertEquals(10, e.getLength());
- }
- });
- assertEquals("0123456789", this.documentAdapter.getText(0, this.documentAdapter.getLength()));
- this.stringHolder.setValue("foo");
- assertTrue(this.eventFired);
- assertEquals("foo", this.documentAdapter.getText(0, this.documentAdapter.getLength()));
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<String> localStringHolder = (SimplePropertyValueModel<String>) this.stringHolder;
- assertFalse(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.documentAdapter);
-
- DocumentListener listener = new TestDocumentListener();
- this.documentAdapter.addDocumentListener(listener);
- assertTrue(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.documentAdapter);
-
- this.documentAdapter.removeDocumentListener(listener);
- assertFalse(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.documentAdapter);
- }
-
- private void verifyHasNoListeners(Object document) throws Exception {
- Object delegate = ClassTools.fieldValue(document, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getDocumentListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object document) throws Exception {
- Object delegate = ClassTools.fieldValue(document, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getDocumentListeners");
- assertFalse(listeners.length == 0);
- }
-
-
-private class TestDocumentListener implements DocumentListener {
- TestDocumentListener() {
- super();
- }
- public void changedUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
- public void insertUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
- public void removeUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
-}
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
deleted file mode 100644
index e38b4eaafa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.WindowConstants;
-import javax.swing.text.AbstractDocument;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.PlainDocument;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of entry fields.
- */
-public class DocumentAdapterUITest {
-
- private TestModel testModel;
- private static final String DEFAULT_NAME = "Scooby Doo";
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<String> nameHolder;
- private Document nameDocument;
- private Document upperCaseNameDocument;
-
- public static void main(String[] args) throws Exception {
- new DocumentAdapterUITest().exec(args);
- }
-
- private DocumentAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel(DEFAULT_NAME);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.nameHolder = this.buildNameHolder(this.testModelHolder);
- this.nameDocument = this.buildNameDocument(this.nameHolder);
- this.upperCaseNameDocument = this.buildUpperCaseNameDocument(this.nameHolder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private Document buildNameDocument(WritablePropertyValueModel<String> stringHolder) {
- return new DocumentAdapter(stringHolder);
- }
-
- private Document buildUpperCaseNameDocument(WritablePropertyValueModel<String> stringHolder) {
- return new DocumentAdapter(stringHolder, this.buildUpperCaseNameDocumentDelegate());
- }
-
- private AbstractDocument buildUpperCaseNameDocumentDelegate() {
- return new PlainDocument() {
- @Override
- public void insertString(int offset, String string, AttributeSet a) throws BadLocationException {
- if (string == null) {
- return;
- }
- char[] upper = string.toCharArray();
- for (int i = 0; i < upper.length; i++) {
- upper[i] = Character.toUpperCase(upper[i]);
- }
- super.insertString(offset, new String(upper), a);
- }
- };
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTextFieldPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTextFieldPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildNameTextField());
- taskListPanel.add(this.buildReadOnlyNameTextField());
- taskListPanel.add(this.buildUpperCaseNameTextField());
- return taskListPanel;
- }
-
- private JTextField buildNameTextField() {
- return new JTextField(this.nameDocument, null, 0);
- }
-
- private JTextField buildReadOnlyNameTextField() {
- JTextField nameTextField = this.buildNameTextField();
- nameTextField.setEditable(false);
- return nameTextField;
- }
-
- private JTextField buildUpperCaseNameTextField() {
- return new JTextField(this.upperCaseNameDocument, null, 0);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetNameButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetNameButton() {
- return new JButton(this.buildResetNameAction());
- }
-
- private Action buildResetNameAction() {
- Action action = new AbstractAction("reset name") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.resetName();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetName() {
- this.testModel.setName(DEFAULT_NAME);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("name: " + this.testModel.getName());
- }
-
-
- private class TestModel extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public TestModel(String name) {
- this.name = name;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.getName() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
deleted file mode 100644
index b531bd3c73..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValueSwingTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValueSwingTests.class.getPackage().getName());
-
- suite.addTestSuite(CheckBoxModelAdapterTests.class);
- suite.addTestSuite(ComboBoxModelAdapterTests.class);
- suite.addTestSuite(DateSpinnerModelAdapterTests.class);
- suite.addTestSuite(DocumentAdapterTests.class);
- suite.addTestSuite(ListModelAdapterTests.class);
- suite.addTestSuite(ListSpinnerModelAdapterTests.class);
- suite.addTestSuite(NumberSpinnerModelAdapterTests.class);
- suite.addTestSuite(ObjectListSelectionModelTests.class);
- suite.addTestSuite(PrimitiveListTreeModelTests.class);
- suite.addTestSuite(RadioButtonModelAdapterTests.class);
- suite.addTestSuite(SpinnerModelAdapterTests.class);
- suite.addTestSuite(TableModelAdapterTests.class);
- suite.addTestSuite(TreeModelAdapterTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValueSwingTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
deleted file mode 100644
index 1488e5fab9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.swing.ListModel;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.CoordinatedList;
-
-import junit.framework.TestCase;
-
-public class ListModelAdapterTests extends TestCase {
-
- public ListModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- // nothing yet...
- }
-
- @Override
- protected void tearDown() throws Exception {
- // nothing yet...
- super.tearDown();
- }
-
- private ListModelAdapter buildListModel(ListValueModel<String> listHolder) {
- return new ListModelAdapter(listHolder) {
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListModel buildListModel(CollectionValueModel<String> collectionHolder) {
- return new ListModelAdapter(collectionHolder) {
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<String> collectionHolder = this.buildCollectionHolder();
- ListModel listModel = this.buildListModel(collectionHolder);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- collectionHolder.add("tom");
- collectionHolder.add("dick");
- collectionHolder.add("harry");
- collectionHolder.add(null);
- assertEquals(10, synchList.size());
- this.compare(listModel, synchList);
-
- collectionHolder.remove("foo");
- collectionHolder.remove("jar");
- collectionHolder.remove("harry");
- collectionHolder.remove(null);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(listHolder);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- listHolder.add(6, "tom");
- listHolder.add(7, "dick");
- listHolder.add(8, "harry");
- listHolder.add(9, null);
- assertEquals(10, synchList.size());
- this.compare(listModel, synchList);
-
- listHolder.remove(9);
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
- }
-
- public void testSetModel() {
- SimpleListValueModel<String> listHolder1 = this.buildListHolder();
- ListModelAdapter listModel = this.buildListModel(listHolder1);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertTrue(listHolder1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- SimpleListValueModel<String> listHolder2 = this.buildListHolder2();
- listModel.setModel(listHolder2);
- assertEquals(3, synchList.size());
- this.compare(listModel, synchList);
- assertTrue(listHolder1.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(listHolder2.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- listModel.setModel(new SimpleListValueModel<String>());
- assertEquals(0, synchList.size());
- this.compare(listModel, synchList);
- assertTrue(listHolder1.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(listHolder2.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void compare(ListModel listModel, List<String> list) {
- assertEquals(listModel.getSize(), list.size());
- for (int i = 0; i < listModel.getSize(); i++) {
- assertEquals(listModel.getElementAt(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<String> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<String> comparator) {
- SimpleCollectionValueModel<String> collectionHolder = this.buildCollectionHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(collectionHolder, comparator));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- collectionHolder.add("tom");
- collectionHolder.add("dick");
- collectionHolder.add("harry");
- assertEquals(9, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- collectionHolder.remove("foo");
- collectionHolder.remove("jar");
- collectionHolder.remove("harry");
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<String> comparator) {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(listHolder, comparator));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- listHolder.add(0, "tom");
- listHolder.add(0, "dick");
- listHolder.add(0, "harry");
- assertEquals(9, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listModel, synchList, comparator);
- }
-
- private void compareSort(ListModel listModel, List<String> list, Comparator<String> comparator) {
- SortedSet<String> ss = new TreeSet<String>(comparator);
- for (int i = 0; i < listModel.getSize(); i++) {
- ss.add((String) listModel.getElementAt(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<String> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListModel listModel = this.buildListModel(listHolder);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasNoListeners(listModel);
-
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasListeners(listModel);
-
- listModel.removeListDataListener(synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasNoListeners(listModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(listHolder);
- this.verifyHasNoListeners(listModel);
- assertEquals(6, listModel.getSize());
-
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- this.verifyHasListeners(listModel);
- assertEquals(6, listModel.getSize());
-
- listModel.removeListDataListener(synchList);
- this.verifyHasNoListeners(listModel);
- assertEquals(6, listModel.getSize());
- }
-
- public void testGetElementAt() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(listHolder));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- this.verifyHasListeners(listModel);
- assertEquals("bar", listModel.getElementAt(0));
- assertEquals("bar", synchList.get(0));
- }
-
- private void verifyHasNoListeners(ListModel listModel) throws Exception {
- boolean hasNoListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasListDataListeners")).booleanValue();
- assertTrue(hasListeners);
- }
-
- private SimpleCollectionValueModel<String> buildCollectionHolder() {
- return new SimpleCollectionValueModel<String>(this.buildCollection());
- }
-
- private Collection<String> buildCollection() {
- Bag<String> bag = new HashBag<String>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<String> buildListHolder() {
- return new SimpleListValueModel<String>(this.buildList());
- }
-
- private List<String> buildList() {
- List<String> list = new ArrayList<String>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<String> c) {
- c.add("foo");
- c.add("bar");
- c.add("baz");
- c.add("joo");
- c.add("jar");
- c.add("jaz");
- }
-
- private SimpleListValueModel<String> buildListHolder2() {
- return new SimpleListValueModel<String>(this.buildList2());
- }
-
- private List<String> buildList2() {
- List<String> list = new ArrayList<String>();
- this.populateCollection2(list);
- return list;
- }
-
- private void populateCollection2(Collection<String> c) {
- c.add("tom");
- c.add("dick");
- c.add("harry");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
deleted file mode 100644
index acebc1fc39..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.ListModel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * an example UI for testing various permutations of the ListModelAdapter
- */
-public class ListModelAdapterUITest {
-
- private WritablePropertyValueModel<TaskList> taskListHolder;
- private TextField taskTextField;
-
- public static void main(String[] args) throws Exception {
- new ListModelAdapterUITest().exec(args);
- }
-
- private ListModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(new TaskList());
- this.openWindow();
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(800, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTaskListPanel(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(0, 1));
- taskListPanel.add(this.buildPrimitiveTaskListPanel());
- taskListPanel.add(this.buildDisplayableTaskListPanel());
- return taskListPanel;
- }
-
- private Component buildPrimitiveTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildUnsortedPrimitiveListPanel());
- taskListPanel.add(this.buildStandardSortedPrimitiveListPanel());
- taskListPanel.add(this.buildCustomSortedPrimitiveListPanel());
- return taskListPanel;
- }
-
- private Component buildDisplayableTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildUnsortedDisplayableListPanel());
- taskListPanel.add(this.buildStandardSortedDisplayableListPanel());
- taskListPanel.add(this.buildCustomSortedDisplayableListPanel());
- return taskListPanel;
- }
-
- private Component buildUnsortedPrimitiveListPanel() {
- return this.buildListPanel("primitive unsorted", this.buildUnsortedPrimitiveListModel());
- }
-
- private Component buildStandardSortedPrimitiveListPanel() {
- return this.buildListPanel("primitive sorted", this.buildStandardSortedPrimitiveListModel());
- }
-
- private Component buildCustomSortedPrimitiveListPanel() {
- return this.buildListPanel("primitive reverse sorted", this.buildCustomSortedPrimitiveListModel());
- }
-
- private Component buildUnsortedDisplayableListPanel() {
- return this.buildListPanel("displayable unsorted", this.buildUnsortedDisplayableListModel());
- }
-
- private Component buildStandardSortedDisplayableListPanel() {
- return this.buildListPanel("displayable sorted", this.buildStandardSortedDisplayableListModel());
- }
-
- private Component buildCustomSortedDisplayableListPanel() {
- return this.buildListPanel("displayable reverse sorted", this.buildCustomSortedDisplayableListModel());
- }
-
- private ListModel buildUnsortedPrimitiveListModel() {
- return new ListModelAdapter(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListModel buildStandardSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator()));
- }
-
- private ListModel buildUnsortedDisplayableListModel() {
- return new ListModelAdapter(this.buildDisplayableTaskListAdapter());
- }
-
- private ListModel buildStandardSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<Task>(this.buildDisplayableTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<Task>(this.buildDisplayableTaskListAdapter(), this.buildCustomTaskObjectComparator()));
- }
-
- private Component buildListPanel(String label, ListModel listModel) {
- JPanel listPanel = new JPanel(new BorderLayout());
- JLabel listLabel = new JLabel(" " + label);
- listPanel.add(listLabel, BorderLayout.NORTH);
-
- JList listBox = new JList();
- listBox.setModel(listModel);
- listBox.setDoubleBuffered(true);
- listLabel.setLabelFor(listBox);
- listPanel.add(new JScrollPane(listBox), BorderLayout.CENTER);
- return listPanel;
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskObjectComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.compareTo(to1);
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(TaskList.TASK_NAMES_LIST, this.taskList()) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildDisplayableTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(TaskList.TASKS_LIST, this.taskList()) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new BorderLayout());
- controlPanel.add(this.buildAddRemoveTaskPanel(), BorderLayout.CENTER);
- controlPanel.add(this.buildClearButton(), BorderLayout.EAST);
- return controlPanel;
- }
-
- private Component buildAddRemoveTaskPanel() {
- JPanel addRemoveTaskPanel = new JPanel(new BorderLayout());
- addRemoveTaskPanel.add(this.buildAddButton(), BorderLayout.WEST);
- addRemoveTaskPanel.add(this.buildTaskTextField(), BorderLayout.CENTER);
- addRemoveTaskPanel.add(this.buildRemoveButton(), BorderLayout.EAST);
- return addRemoveTaskPanel;
- }
-
- private String getTask() {
- return this.taskTextField.getText();
- }
-
- private TaskList taskList() {
- return this.taskListHolder.getValue();
- }
-
- void addTask() {
- String task = this.getTask();
- if (task.length() != 0) {
- this.taskList().addTask(task);
- }
- }
-
- void removeTask() {
- String task = this.getTask();
- if (task.length() != 0) {
- this.taskList().removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList().clearTasks();
- }
-
- private TextField buildTaskTextField() {
- this.taskTextField = new TextField();
- return this.taskTextField;
- }
-
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.addTask();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- Action action = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.removeTask();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private JButton buildClearButton() {
- return new JButton(this.buildClearAction());
- }
-
- private Action buildClearAction() {
- Action action = new AbstractAction("clear") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.clearTasks();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private class TaskList extends AbstractModel {
- private List<String> taskNames = new ArrayList<String>();
- private List<Task> taskObjects = new ArrayList<Task>();
- public static final String TASK_NAMES_LIST = "taskNames";
- public static final String TASKS_LIST = "tasks";
- TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public ListIterator<Task> tasks() {
- return this.taskObjects.listIterator();
- }
- public void addTask(String taskName) {
- int index = this.taskNames.size();
- this.taskNames.add(index, taskName);
- this.fireItemAdded(TASK_NAMES_LIST, index, taskName);
-
- Task taskObject = new Task(taskName);
- this.taskObjects.add(index, taskObject);
- this.fireItemAdded(TASKS_LIST, index, taskObject);
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- Object removedTask = this.taskNames.remove(index);
- this.fireItemRemoved(TASK_NAMES_LIST, index, removedTask);
- // assume the indexes match...
- Object removedTaskObject = this.taskObjects.remove(index);
- this.fireItemRemoved(TASKS_LIST, index, removedTaskObject);
- }
- }
- public void clearTasks() {
- this.taskNames.clear();
- this.fireListChanged(TASK_NAMES_LIST);
- this.taskObjects.clear();
- this.fireListChanged(TASKS_LIST);
- }
- }
-
- private class Task extends AbstractModel implements Displayable {
- private String name;
- private Date creationTimeStamp;
- public Task(String name) {
- this.name = name;
- this.creationTimeStamp = new Date();
- }
- public String displayString() {
- return this.name + ": " + this.creationTimeStamp.getTime();
- }
- public Icon icon() {
- return null;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.displayString());
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
deleted file mode 100644
index d8e8255c51..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ListSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
- private static final String[] VALUE_LIST = {"red", "green", "blue"};
- private static final String DEFAULT_VALUE = VALUE_LIST[0];
-
- public ListSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(DEFAULT_VALUE);
- this.spinnerModelAdapter = new ListSpinnerModelAdapter(this.valueHolder, VALUE_LIST) {
- @Override
- protected PropertyChangeListener buildValueChangeListener() {
- return this.buildValueChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.valueHolder.getValue());
- this.spinnerModelAdapter.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.valueHolder.getValue());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.spinnerModelAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.spinnerModelAdapter.getValue());
-
- this.valueHolder.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.spinnerModelAdapter.getValue());
-
- this.eventFired = false;
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[0], this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((ListSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((ListSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
deleted file mode 100644
index 985d28116e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NumberSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Number> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public NumberSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Number>(new Integer(0));
- this.spinnerModelAdapter = new NumberSpinnerModelAdapter(this.valueHolder, -33, 33, 1) {
- @Override
- protected PropertyChangeListener buildNumberChangeListener() {
- return this.buildNumberChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- this.spinnerModelAdapter.setValue(new Integer(5));
- assertTrue(this.eventFired);
- assertEquals(new Integer(5), this.valueHolder.getValue());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertEquals(new Integer(-33), this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Number> localValueHolder = (SimplePropertyValueModel<Number>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((NumberSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((NumberSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
- public void testNullInitialValue() {
- this.valueHolder = new SimplePropertyValueModel<Number>();
- this.spinnerModelAdapter = new NumberSpinnerModelAdapter(this.valueHolder, new Integer(-33), new Integer(33), new Integer(1), new Integer(0)) {
- @Override
- protected PropertyChangeListener buildNumberChangeListener() {
- return this.buildNumberChangeListener_();
- }
- };
-
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
-
- // ********** inner class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
deleted file mode 100644
index 1935068f27..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.DefaultListModel;
-import javax.swing.ListModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ObjectListSelectionModelTests extends TestCase {
- private DefaultListModel listModel;
- private ObjectListSelectionModel selectionModel;
-
- public ObjectListSelectionModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listModel = this.buildListModel();
- this.selectionModel = this.buildSelectionModel(this.listModel);
- }
-
- private DefaultListModel buildListModel() {
- DefaultListModel lm = new DefaultListModel();
- lm.addElement("foo");
- lm.addElement("bar");
- lm.addElement("baz");
- return lm;
- }
-
- private ObjectListSelectionModel buildSelectionModel(ListModel lm) {
- return new ObjectListSelectionModel(lm);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testListDataListener() {
- this.selectionModel.addListSelectionListener(this.buildListSelectionListener());
- this.selectionModel.setSelectionInterval(0, 0);
- assertEquals("foo", this.selectionModel.selectedValue());
- this.listModel.set(0, "jar");
- assertEquals("jar", this.selectionModel.selectedValue());
- }
-
- public void testGetSelectedValue() {
- this.selectionModel.setSelectionInterval(0, 0);
- assertEquals("foo", this.selectionModel.selectedValue());
- }
-
- public void testGetSelectedValues() {
- this.selectionModel.setSelectionInterval(0, 0);
- this.selectionModel.addSelectionInterval(2, 2);
- assertEquals(2, this.selectionModel.selectedValues().length);
- assertTrue(CollectionTools.contains(this.selectionModel.selectedValues(), "foo"));
- assertTrue(CollectionTools.contains(this.selectionModel.selectedValues(), "baz"));
- }
-
- public void testSetSelectedValue() {
- this.selectionModel.setSelectedValue("foo");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(0, this.selectionModel.getMaxSelectionIndex());
- }
-
- public void testSetSelectedValues() {
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz"});
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(2, this.selectionModel.getMaxSelectionIndex());
- }
-
- public void testAddSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValue("jaz");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(5, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertFalse(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertFalse(this.selectionModel.isSelectedIndex(4));
- assertTrue(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testAddSelectedValues() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(4, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertTrue(this.selectionModel.isSelectedIndex(1));
- assertFalse(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertTrue(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testRemoveSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz", "jar"});
- this.selectionModel.removeSelectedValue("jar");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(2, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertTrue(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertFalse(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testRemoveSelectedValues() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz", "joo", "jar"});
- this.selectionModel.removeSelectedValues(new Object[] {"foo", "joo"});
- assertEquals(2, this.selectionModel.getMinSelectionIndex());
- assertEquals(4, this.selectionModel.getMaxSelectionIndex());
- assertFalse(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertTrue(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertTrue(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testGetAnchorSelectedValue() {
- this.selectionModel.setAnchorSelectionIndex(1);
- assertEquals("bar", this.selectionModel.getAnchorSelectedValue());
- }
-
- public void testGetLeadSelectedValue() {
- this.selectionModel.setSelectedValue("bar");
- assertEquals("bar", this.selectionModel.getLeadSelectedValue());
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz"});
- assertEquals("baz", this.selectionModel.getLeadSelectedValue());
- }
-
- public void testGetMinMaxSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertEquals("foo", this.selectionModel.getMinSelectedValue());
- assertEquals("jar", this.selectionModel.getMaxSelectedValue());
- }
-
- public void testValueIsSelected() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertTrue(this.selectionModel.valueIsSelected("foo"));
- assertTrue(this.selectionModel.valueIsSelected("bar"));
- assertTrue(this.selectionModel.valueIsSelected("jar"));
- assertFalse(this.selectionModel.valueIsSelected("baz"));
- }
-
- public void testHasListeners() throws Exception {
- ListSelectionListener listener = this.buildListSelectionListener();
- assertEquals(0, this.listModel.getListDataListeners().length);
- this.selectionModel.addListSelectionListener(listener);
- assertEquals(1, this.listModel.getListDataListeners().length);
- this.selectionModel.removeListSelectionListener(listener);
- assertEquals(0, this.listModel.getListDataListeners().length);
- }
-
- private ListSelectionListener buildListSelectionListener() {
- return new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- // do nothing for now...
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
deleted file mode 100644
index df9e200232..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeModel;
-
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.PrimitiveListTreeModel;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PrimitiveListTreeModelTests extends TestCase {
- TestModel testModel;
- private TreeModel treeModel;
-
- public PrimitiveListTreeModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testModel = this.buildTestModel();
- this.treeModel = this.buildTreeModel();
- }
-
- private TestModel buildTestModel() {
- return new TestModel();
- }
-
- private TreeModel buildTreeModel() {
- return new PrimitiveListTreeModel(this.buildListValueModel()) {
- @Override
- protected void primitiveChanged(int index, Object newValue) {
- if ( ! newValue.equals("")) {
- PrimitiveListTreeModelTests.this.testModel.replaceName(index, (String) newValue);
- }
- }
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListValueModel<?> buildListValueModel() {
- return new ListAspectAdapter<TestModel, String>(TestModel.NAMES_LIST, this.testModel) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.names();
- }
- @Override
- public String get(int index) {
- return this.subject.getName(index);
- }
- @Override
- public int size() {
- return this.subject.namesSize();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAddPrimitive() {
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {0}, new String[] {"foo"});
- }
- });
- this.testModel.addName("foo");
- }
-
- public void testRemovePrimitive() {
- this.testModel.addName("foo");
- this.testModel.addName("bar");
- this.testModel.addName("baz");
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {1}, new String[] {"bar"});
- }
- });
- String name = this.testModel.removeName(1);
- assertEquals("bar", name);
- }
-
- public void testReplacePrimitive() {
- this.testModel.addName("foo");
- this.testModel.addName("bar");
- this.testModel.addName("baz");
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesChanged(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {1}, new String[] {"jar"});
- }
- });
- String name = this.testModel.replaceName(1, "jar");
- assertEquals("bar", name);
- }
-
- void verifyTreeModelEvent(TreeModelEvent e, int[] expectedChildIndices, String[] expectedNames) {
- assertTrue(Arrays.equals(expectedChildIndices, e.getChildIndices()));
- Object[] actualChildren = e.getChildren();
- assertEquals(expectedNames.length, actualChildren.length);
- for (int i = 0; i < expectedNames.length; i++) {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode) actualChildren[i];
- assertEquals(expectedNames[i], node.getUserObject());
- }
- assertEquals(1, e.getPath().length);
- assertEquals(this.treeModel.getRoot(), e.getPath()[0]);
- assertEquals(this.treeModel, e.getSource());
- }
-
-
-// ********** inner classes **********
-
- private class TestModel extends AbstractModel {
- private final List<String> names;
- static final String NAMES_LIST = "names";
-
- TestModel() {
- super();
- this.names = new ArrayList<String>();
- }
-
- public ListIterator<String> names() {
- return new ReadOnlyListIterator<String>(this.names);
- }
- public int namesSize() {
- return this.names.size();
- }
- public String getName(int index) {
- return this.names.get(index);
- }
- public void addName(int index, String name) {
- this.addItemToList(index, name, this.names, NAMES_LIST);
- }
- public void addName(String name) {
- this.addName(this.namesSize(), name);
- }
- public void addNames(int index, List<String> list) {
- this.addItemsToList(index, this.names, list, NAMES_LIST);
- }
- public void addNames(List<String> list) {
- this.addNames(this.namesSize(), list);
- }
- public String removeName(int index) {
- return this.removeItemFromList(index, this.names, NAMES_LIST);
- }
- public List<String> removeNames(int index, int length) {
- return this.removeItemsFromList(index, length, this.names, NAMES_LIST);
- }
- public String replaceName(int index, String newName) {
- return this.setItemInList(index, newName, this.names, NAMES_LIST);
- }
- }
-
-
- public class TestTreeModelListener implements TreeModelListener {
- public void treeNodesChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesInserted(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesRemoved(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeStructureChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
deleted file mode 100644
index 4617c45990..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.ButtonModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class RadioButtonModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
-
- private ButtonModel redButtonModelAdapter;
- private ChangeListener redListener;
- boolean redEventFired;
-
- private ButtonModel greenButtonModelAdapter;
- private ChangeListener greenListener;
- boolean greenEventFired;
-
- private ButtonModel blueButtonModelAdapter;
- private ChangeListener blueListener;
- boolean blueEventFired;
-
-// private ButtonGroup buttonGroup; // DO NOT use a ButtonGroup
-
- private static final String RED = "red";
- private static final String GREEN = "green";
- private static final String BLUE = "blue";
-
- public RadioButtonModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(null);
-// buttonGroup = new ButtonGroup();
-
- this.redButtonModelAdapter = this.buildButtonModel(this.valueHolder, RED);
-// this.redButtonModelAdapter.setGroup(buttonGroup);
- this.redListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.redEventFired = true;
- }
- };
-
- this.greenButtonModelAdapter = this.buildButtonModel(this.valueHolder, GREEN);
-// this.greenButtonModelAdapter.setGroup(buttonGroup);
- this.greenListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.greenEventFired = true;
- }
- };
-
- this.blueButtonModelAdapter = this.buildButtonModel(this.valueHolder, BLUE);
-// this.blueButtonModelAdapter.setGroup(buttonGroup);
- this.blueListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.blueEventFired = true;
- }
- };
-
- this.clearFlags();
- }
-
- private ButtonModel buildButtonModel(WritablePropertyValueModel<Object> pvm, Object buttonValue) {
- return new RadioButtonModelAdapter(pvm, buttonValue) {
- @Override
- protected PropertyChangeListener buildBooleanChangeListener() {
- return this.buildBooleanChangeListener_();
- }
- };
- }
-
- private void listenToModelAdapters() {
- this.redButtonModelAdapter.addChangeListener(this.redListener);
- this.greenButtonModelAdapter.addChangeListener(this.greenListener);
- this.blueButtonModelAdapter.addChangeListener(this.blueListener);
- }
-
- private void clearFlags() {
- this.redEventFired = false;
- this.greenEventFired = false;
- this.blueEventFired = false;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetSelected() throws Exception {
- this.listenToModelAdapters();
-
- this.greenButtonModelAdapter.setSelected(true);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertFalse(this.blueEventFired);
- assertEquals(GREEN, this.valueHolder.getValue());
-
- this.clearFlags();
- this.blueButtonModelAdapter.setSelected(true);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertEquals(BLUE, this.valueHolder.getValue());
-
- this.clearFlags();
- this.redButtonModelAdapter.setSelected(true);
- assertTrue(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertEquals(RED, this.valueHolder.getValue());
- }
-
- public void testSetValue() throws Exception {
- this.listenToModelAdapters();
-
- this.greenButtonModelAdapter.setSelected(true);
-
- this.clearFlags();
- this.valueHolder.setValue(BLUE);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertTrue(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(RED);
- assertTrue(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertTrue(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
- }
-
- public void testDefaultValue() throws Exception {
- this.listenToModelAdapters();
-
- this.valueHolder.setValue(GREEN);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertTrue(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(null);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertFalse(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(BLUE);
- assertFalse(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertTrue(this.blueButtonModelAdapter.isSelected());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.redButtonModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
-
- this.redButtonModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
- }
-
- private void verifyHasNoListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertFalse(listenerList.getListenerList().length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
deleted file mode 100644
index b75725f49d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * Play around with a set of radio buttons.
- */
-public class RadioButtonModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Object> colorHolder;
- private ButtonModel redButtonModel;
- private ButtonModel greenButtonModel;
- private ButtonModel blueButtonModel;
-
- public static void main(String[] args) throws Exception {
- new RadioButtonModelAdapterUITest().exec(args);
- }
-
- private RadioButtonModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.colorHolder = this.buildColorHolder(this.testModelHolder);
- this.redButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.RED);
- this.greenButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.GREEN);
- this.blueButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.BLUE);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildColorHolder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Object>(subjectHolder, TestModel.COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setColor((String) value);
- }
- };
- }
-
- private ButtonModel buildRadioButtonModelAdapter(WritablePropertyValueModel<Object> colorPVM, String color) {
- return new RadioButtonModelAdapter(colorPVM, color);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setLocation(200, 200);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildRadioButtonPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildRadioButtonPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildRedRadioButton());
- taskListPanel.add(this.buildGreenRadioButton());
- taskListPanel.add(this.buildBlueRadioButton());
- return taskListPanel;
- }
-
- private JRadioButton buildRedRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("red");
- radioButton.setModel(this.redButtonModel);
- return radioButton;
- }
-
- private JRadioButton buildGreenRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("green");
- radioButton.setModel(this.greenButtonModel);
- return radioButton;
- }
-
- private JRadioButton buildBlueRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("blue");
- radioButton.setModel(this.blueButtonModel);
- return radioButton;
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetColorButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetColorButton() {
- return new JButton(this.buildResetColorAction());
- }
-
- private Action buildResetColorAction() {
- Action action = new AbstractAction("reset color") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.resetColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetColor() {
- this.testModel.setColor(TestModel.DEFAULT_COLOR);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println(this.testModel);
- }
-
-
- private static class TestModel extends AbstractModel {
- private String color;
- public static final String COLOR_PROPERTY = "color";
- public static final String RED = "red";
- public static final String GREEN = "green";
- public static final String BLUE = "blue";
- public static final String DEFAULT_COLOR = RED;
- public static final String[] VALID_COLORS = {
- RED,
- GREEN,
- BLUE
- };
-
- public TestModel() {
- this(DEFAULT_COLOR);
- }
- public TestModel(String color) {
- this.color = color;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor(String color) {
- if ( ! CollectionTools.contains(VALID_COLORS, color)) {
- throw new IllegalArgumentException(color);
- }
- Object old = this.color;
- this.color = color;
- this.firePropertyChanged(COLOR_PROPERTY, old, color);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.color + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
deleted file mode 100644
index 3bfb66f4ba..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.PersonColumnAdapter;
-
-/**
- * Make it easy to test the table model adapter and
- * renderers without any editing allowed.
- */
-public class ReadOnlyTableModelAdapterUITest extends TableModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ReadOnlyTableModelAdapterUITest().exec(args);
- }
-
- protected ReadOnlyTableModelAdapterUITest() {
- super();
- }
-
- @Override
- protected ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter() {
- @Override
- public boolean columnIsEditable(int index) {
- return false;
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
deleted file mode 100644
index 1d4b0efd3d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.SpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public SpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(new Integer(0));
- this.spinnerModelAdapter = new SpinnerModelAdapter(this.valueHolder) {
- @Override
- protected PropertyChangeListener buildValueListener() {
- return this.buildValueListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- SpinnerModelAdapterTests.this.eventFired = true;
- assertEquals(SpinnerModelAdapterTests.this.spinnerModelAdapter, e.getSource());
- }
- });
- this.spinnerModelAdapter.setValue(new Integer(5));
- assertTrue(this.eventFired);
- assertEquals(new Integer(5), this.valueHolder.getValue());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- SpinnerModelAdapterTests.this.eventFired = true;
- assertEquals(SpinnerModelAdapterTests.this.spinnerModelAdapter, e.getSource());
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(Object adapter) throws Exception {
- Object delegate = ClassTools.fieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getChangeListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- Object delegate = ClassTools.fieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getChangeListeners");
- assertFalse(listeners.length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
deleted file mode 100644
index 9c6ec4419e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JSpinner;
-import javax.swing.SpinnerModel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of spinners.
- */
-public class SpinnerModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
-
- private WritablePropertyValueModel<Object> birthDateHolder;
- private SpinnerModel birthDateSpinnerModel;
-
- private WritablePropertyValueModel<Number> ageHolder;
- private SpinnerModel ageSpinnerModel;
-
- private WritablePropertyValueModel<Object> eyeColorHolder;
- private SpinnerModel eyeColorSpinnerModel;
-
-
- public static void main(String[] args) throws Exception {
- new SpinnerModelAdapterUITest().exec(args);
- }
-
- private SpinnerModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
-
- this.birthDateHolder = this.buildBirthDateHolder(this.testModelHolder);
- this.birthDateSpinnerModel = this.buildBirthDateSpinnerModel(this.birthDateHolder);
-
- this.ageHolder = this.buildAgeHolder(this.testModelHolder);
- this.ageSpinnerModel = this.buildAgeSpinnerModel(this.ageHolder);
-
- this.eyeColorHolder = this.buildEyeColorHolder(this.testModelHolder);
- this.eyeColorSpinnerModel = this.buildEyeColorSpinnerModel(this.eyeColorHolder);
-
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.BIRTH_DATE_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
- private SpinnerModel buildBirthDateSpinnerModel(WritablePropertyValueModel<Object> valueHolder) {
- return new DateSpinnerModelAdapter(valueHolder);
- }
-
- private WritablePropertyValueModel<Number> buildAgeHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Number>(vm, TestModel.AGE_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getAge());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setAge(value.intValue());
- }
- };
- }
-
- private SpinnerModel buildAgeSpinnerModel(WritablePropertyValueModel<Number> valueHolder) {
- return new NumberSpinnerModelAdapter(valueHolder, valueHolder.getValue().intValue(), TestModel.MIN_AGE, TestModel.MAX_AGE, 1);
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.EYE_COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
- private SpinnerModel buildEyeColorSpinnerModel(WritablePropertyValueModel<Object> valueHolder) {
- return new ListSpinnerModelAdapter(valueHolder, TestModel.VALID_EYE_COLORS);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(600, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildSpinnerPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildSpinnerPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildBirthDateSpinner());
- taskListPanel.add(this.buildAgeSpinner());
- taskListPanel.add(this.buildEyeColorSpinner());
- return taskListPanel;
- }
-
- private JSpinner buildBirthDateSpinner() {
- return new JSpinner(this.birthDateSpinnerModel);
- }
-
- private JSpinner buildAgeSpinner() {
- return new JSpinner(this.ageSpinnerModel);
- }
-
- private JSpinner buildEyeColorSpinner() {
- return new JSpinner(this.eyeColorSpinnerModel);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetModelButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetModelButton() {
- return new JButton(this.buildResetModelAction());
- }
-
- private Action buildResetModelAction() {
- Action action = new AbstractAction("reset model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.resetModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetModel() {
- this.testModel.setBirthDate(TestModel.DEFAULT_BIRTH_DATE);
- this.testModel.setEyeColor(TestModel.DEFAULT_EYE_COLOR);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("birth date: " + this.testModel.getBirthDate());
- System.out.println("age: " + this.testModel.getAge());
- System.out.println("eyes: " + this.testModel.getEyeColor());
- }
-
-
- private static class TestModel extends AbstractModel {
- private Calendar birthCal = Calendar.getInstance();
- // "virtual" properties
- public static final String BIRTH_DATE_PROPERTY = "birthDate";
- public static final String AGE_PROPERTY = "age";
- public static final Date DEFAULT_BIRTH_DATE = new Date();
- public static final int DEFAULT_AGE = 0;
- public static final int MIN_AGE = 0;
- public static final int MAX_AGE = 150;
- private String eyeColor;
- public static final String EYE_COLOR_PROPERTY = "eyeColor";
- public static final String[] VALID_EYE_COLORS = {"blue", "brown", "green", "hazel", "pink"};
- public static final String DEFAULT_EYE_COLOR = VALID_EYE_COLORS[3];
-
- public TestModel() {
- this(DEFAULT_BIRTH_DATE, DEFAULT_EYE_COLOR);
- }
- public TestModel(Date birthDate, String eyeColor) {
- this.setBirthDate(birthDate);
- this.setEyeColor(eyeColor);
- }
- public Date getBirthDate() {
- return (Date) this.birthCal.getTime().clone();
- }
- public void setBirthDate(Date birthDate) {
- Date oldBirthDate = this.getBirthDate();
- int oldAge = this.getAge();
- this.birthCal.setTimeInMillis(birthDate.getTime());
- int newAge = this.getAge();
- if (newAge < MIN_AGE || newAge > MAX_AGE) {
- throw new IllegalArgumentException(birthDate.toString());
- }
- this.firePropertyChanged(BIRTH_DATE_PROPERTY, oldBirthDate, this.getBirthDate());
- this.firePropertyChanged(AGE_PROPERTY, oldAge, newAge);
- }
- public int getAge() {
- Calendar currentCal = Calendar.getInstance();
- int age = currentCal.get(Calendar.YEAR) - this.birthCal.get(Calendar.YEAR);
- if (currentCal.get(Calendar.MONTH) < this.birthCal.get(Calendar.MONTH)) {
- age--;
- } else if (currentCal.get(Calendar.MONTH) == this.birthCal.get(Calendar.MONTH)) {
- if (currentCal.get(Calendar.DAY_OF_MONTH) < this.birthCal.get(Calendar.DAY_OF_MONTH)) {
- age--;
- }
- }
- return age;
- }
- public void setAge(int newAge) {
- if (newAge < MIN_AGE || newAge > MAX_AGE) {
- throw new IllegalArgumentException(String.valueOf(newAge));
- }
-
- int oldAge = this.getAge();
- int delta = newAge - oldAge;
-
- Calendar newBirthCal = Calendar.getInstance();
- newBirthCal.setTimeInMillis(this.birthCal.getTime().getTime());
- // if the age increased, the birth date must be "decreased"; and vice versa
- newBirthCal.set(Calendar.YEAR, newBirthCal.get(Calendar.YEAR) - delta);
- this.setBirthDate(newBirthCal.getTime());
- }
- public String getEyeColor() {
- return this.eyeColor;
- }
- public void setEyeColor(String eyeColor) {
- if ( ! CollectionTools.contains(VALID_EYE_COLORS, eyeColor)) {
- throw new IllegalArgumentException(eyeColor);
- }
- Object old = this.eyeColor;
- this.eyeColor = eyeColor;
- this.firePropertyChanged(EYE_COLOR_PROPERTY, old, eyeColor);
- }
- @Override
- public String toString() {
- return "TestModel(birth: " + this.getBirthDate() + " - eyes: " + this.eyeColor + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
deleted file mode 100644
index c253c723a5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-public class TableModelAdapterTests extends TestCase {
- private Crowd crowd;
- TableModelEvent event;
-
- public TableModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.crowd = this.buildCrowd();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetRowCount() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- assertEquals(0, tableModelAdapter.getRowCount());
- // we need to add a listener to wake up the adapter
- tableModelAdapter.addTableModelListener(this.buildTableModelListener());
- assertEquals(this.crowd.peopleSize(), tableModelAdapter.getRowCount());
- }
-
- public void testGetColumnCount() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- assertEquals(PersonColumnAdapter.COLUMN_COUNT, tableModelAdapter.getColumnCount());
- }
-
- public void testGetValueAt() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- tableModelAdapter.addTableModelListener(this.buildTableModelListener());
-
- List<String> sortedNames = this.sortedNames();
- for (int i = 0; i < this.crowd.peopleSize(); i++) {
- assertEquals(sortedNames.get(i), tableModelAdapter.getValueAt(i, PersonColumnAdapter.NAME_COLUMN));
- }
- }
-
- public void testSetValueAt() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(new TestTableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- TableModelAdapterTests.this.event = e;
- }
- });
-
- Person person = this.crowd.personNamed("Gollum");
- assertEquals(Person.EYE_COLOR_BLUE, person.getEyeColor());
- assertFalse(person.isEvil());
- assertEquals(0, person.getRank());
-
- for (int i = 0; i < tableModelAdapter.getRowCount(); i++) {
- if (tableModelAdapter.getValueAt(i, PersonColumnAdapter.NAME_COLUMN).equals("Gollum")) {
- tableModelAdapter.setValueAt(Person.EYE_COLOR_HAZEL, i, PersonColumnAdapter.EYE_COLOR_COLUMN);
- tableModelAdapter.setValueAt(Boolean.TRUE, i, PersonColumnAdapter.EVIL_COLUMN);
- tableModelAdapter.setValueAt(new Integer(-1), i, PersonColumnAdapter.RANK_COLUMN);
- break;
- }
- }
- assertNotNull(this.event);
- assertEquals(Person.EYE_COLOR_HAZEL, person.getEyeColor());
- assertTrue(person.isEvil());
- assertEquals(-1, person.getRank());
- }
-
- public void testAddRow() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // add a person to the end of the list so we only trigger one event
- this.crowd.addPerson("Zzzzz");
- assertNotNull(this.event);
- assertEquals(TableModelEvent.INSERT, this.event.getType());
- assertEquals(TableModelEvent.ALL_COLUMNS, this.event.getColumn());
- }
-
- public void testRemoveRow() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // removing a person should only trigger one event, since a re-sort is not needed
- this.crowd.removePerson(this.crowd.personNamed("Gollum"));
- assertNotNull(this.event);
- assertEquals(TableModelEvent.DELETE, this.event.getType());
- assertEquals(TableModelEvent.ALL_COLUMNS, this.event.getColumn());
- }
-
- public void testChangeCell() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // add a person to the end of the list so we only trigger one event
- Person person = this.crowd.personNamed("Gollum");
- person.setEvil(true);
- assertNotNull(this.event);
- assertEquals(TableModelEvent.UPDATE, this.event.getType());
- assertEquals(PersonColumnAdapter.EVIL_COLUMN, this.event.getColumn());
- }
-
- public void testLazyListListener() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- TableModelListener listener = this.buildTableModelListener();
- assertTrue(this.crowd.hasNoCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- tableModelAdapter.addTableModelListener(listener);
- assertTrue(this.crowd.hasAnyCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- tableModelAdapter.removeTableModelListener(listener);
- assertTrue(this.crowd.hasNoCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- }
-
- public void testLazyCellListener() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- TableModelListener listener = this.buildTableModelListener();
- Person person = this.crowd.personNamed("Gollum");
- assertTrue(person.hasNoPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.RANK_PROPERTY));
-
- tableModelAdapter.addTableModelListener(listener);
- assertTrue(person.hasAnyPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.RANK_PROPERTY));
-
- tableModelAdapter.removeTableModelListener(listener);
- assertTrue(person.hasNoPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.RANK_PROPERTY));
- }
-
- private TableModelAdapter<Person> buildTableModelAdapter() {
- return new TableModelAdapter<Person>(this.buildSortedPeopleAdapter(), this.buildColumnAdapter()) {
- @Override
- protected PropertyChangeListener buildCellListener() {
- return this.buildCellListener_();
- }
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListValueModel<Person> buildSortedPeopleAdapter() {
- return new SortedListValueModelAdapter<Person>(this.buildPeopleAdapter());
- }
-
- private CollectionValueModel<Person> buildPeopleAdapter() {
- return new CollectionAspectAdapter<Crowd, Person>(Crowd.PEOPLE_COLLECTION, this.crowd) {
- @Override
- protected Iterator<Person> iterator_() {
- return this.subject.people();
- }
- @Override
- protected int size_() {
- return this.subject.peopleSize();
- }
- };
- }
-
- private Crowd buildCrowd() {
- Crowd result = new Crowd();
- result.addPerson("Bilbo");
- result.addPerson("Gollum");
- result.addPerson("Frodo");
- result.addPerson("Samwise");
- return result;
- }
-
- private ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter();
- }
-
- private TableModelListener buildTableModelListener() {
- return new TestTableModelListener();
- }
-
- private List<String> sortedNames() {
- return new ArrayList<String>(CollectionTools.sortedSet(this.crowd.peopleNames()));
- }
-
- private TableModelListener buildSingleEventListener() {
- return new TestTableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- // we expect only a single event
- if (TableModelAdapterTests.this.event == null) {
- TableModelAdapterTests.this.event = e;
- } else {
- fail("unexpected event");
- }
- }
- };
- }
-
-
- // ********** classes **********
-
- public static class PersonColumnAdapter implements ColumnAdapter {
- public static final int COLUMN_COUNT = 7;
-
- public static final int NAME_COLUMN = 0;
- public static final int BIRTH_DATE_COLUMN = 1;
- public static final int GONE_WEST_DATE_COLUMN = 2;
- public static final int EYE_COLOR_COLUMN = 3;
- public static final int EVIL_COLUMN = 4;
- public static final int RANK_COLUMN = 5;
- public static final int ADVENTURE_COUNT_COLUMN = 6;
-
- private static final String[] COLUMN_NAMES = new String[] {
- "Name",
- "Birth",
- "Gone West",
- "Eyes",
- "Evil",
- "Rank",
- "Adventures"
- };
-
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int index) {
- return COLUMN_NAMES[index];
- }
-
- public Class<?> columnClass(int index) {
- switch (index) {
- case NAME_COLUMN: return Object.class;
- case BIRTH_DATE_COLUMN: return Date.class;
- case GONE_WEST_DATE_COLUMN: return Date.class;
- case EYE_COLOR_COLUMN: return Object.class;
- case EVIL_COLUMN: return Boolean.class;
- case RANK_COLUMN: return Integer.class;
- case ADVENTURE_COUNT_COLUMN:return Integer.class;
- default: return Object.class;
- }
- }
-
- public boolean columnIsEditable(int index) {
- return index != NAME_COLUMN;
- }
-
- public WritablePropertyValueModel<Object>[] cellModels(Object subject) {
- Person person = (Person) subject;
- @SuppressWarnings("unchecked")
- WritablePropertyValueModel<Object>[] result = new WritablePropertyValueModel[COLUMN_COUNT];
-
- result[NAME_COLUMN] = this.buildNameAdapter(person);
- result[BIRTH_DATE_COLUMN] = this.buildBirthDateAdapter(person);
- result[GONE_WEST_DATE_COLUMN] = this.buildGoneWestDateAdapter(person);
- result[EYE_COLOR_COLUMN] = this.buildEyeColorAdapter(person);
- result[EVIL_COLUMN] = this.buildEvilAdapter(person);
- result[RANK_COLUMN] = this.buildRankAdapter(person);
- result[ADVENTURE_COUNT_COLUMN] = this.buildAdventureCountAdapter(person);
-
- return result;
- }
-
- private WritablePropertyValueModel<Object> buildNameAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.NAME_PROPERTY, person) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setName((String) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.BIRTH_DATE_PROPERTY, person) {
- @Override
- protected Date buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildGoneWestDateAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.GONE_WEST_DATE_PROPERTY, person) {
- @Override
- protected Date buildValue_() {
- return this.subject.getGoneWestDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setGoneWestDate((Date) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.EYE_COLOR_PROPERTY, person) {
- @Override
- protected String buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildEvilAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.EVIL_PROPERTY, person) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isEvil());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEvil(((Boolean)value).booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildRankAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.RANK_PROPERTY, person) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getRank());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setRank(((Integer) value).intValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildAdventureCountAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.ADVENTURE_COUNT_PROPERTY, person) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getAdventureCount());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setAdventureCount(((Integer) value).intValue());
- }
- };
- }
-
- }
-
-
- public static class Crowd extends AbstractModel {
- private final Collection<Person> people;
- public static final String PEOPLE_COLLECTION = "people";
-
- public Crowd() {
- super();
- this.people = new ArrayList<Person>();
- }
-
-
- public Iterator<Person> people() {
- return new CloneIterator<Person>(this.people) {
- @Override
- protected void remove(Person person) {
- Crowd.this.removePerson(person);
- }
- };
- }
-
- public int peopleSize() {
- return this.people.size();
- }
-
- public Person addPerson(String name) {
- this.checkPersonName(name);
- return this.addPerson(new Person(this, name));
- }
-
- private Person addPerson(Person person) {
- this.addItemToCollection(person, this.people, PEOPLE_COLLECTION);
- return person;
- }
-
- public void removePerson(Person person) {
- this.removeItemFromCollection(person, this.people, PEOPLE_COLLECTION);
- }
-
- public void removePeople(Collection<Person> persons) {
- this.removeItemsFromCollection(persons, this.people, PEOPLE_COLLECTION);
- }
-
- public void removePeople(Iterator<Person> persons) {
- this.removeItemsFromCollection(persons, this.people, PEOPLE_COLLECTION);
- }
-
- void checkPersonName(String personName) {
- if (personName == null) {
- throw new NullPointerException();
- }
- if (CollectionTools.contains(this.peopleNames(), personName)) {
- throw new IllegalArgumentException(personName);
- }
- }
-
- public Iterator<String> peopleNames() {
- return new TransformationIterator<Person, String>(this.people.iterator()) {
- @Override
- protected String transform(Person person) {
- return person.getName();
- }
- };
- }
-
- public Person personNamed(String name) {
- for (Iterator<Person> stream = this.people.iterator(); stream.hasNext(); ) {
- Person person = stream.next();
- if (person.getName().equals(name)) {
- return person;
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, String.valueOf(this.people.size()) + " people");
- }
-
- }
-
-
- public static class Person extends AbstractModel implements Comparable<Person> {
- private Crowd crowd;
- private String name;
- public static final String NAME_PROPERTY= "name";
- private Date birthDate;
- public static final String BIRTH_DATE_PROPERTY= "birthDate";
- private Date goneWestDate;
- public static final String GONE_WEST_DATE_PROPERTY= "goneWestDate";
- private String eyeColor;
- public static final String EYE_COLOR_PROPERTY= "eyeColor";
- public static final String EYE_COLOR_BLUE = "blue";
- public static final String EYE_COLOR_GREEN = "green";
- public static final String EYE_COLOR_BROWN = "brown";
- public static final String EYE_COLOR_HAZEL = "hazel";
- public static final String EYE_COLOR_PINK = "pink";
- private static Collection<String> validEyeColors;
- public static final String DEFAULT_EYE_COLOR = EYE_COLOR_BLUE;
- private boolean evil;
- public static final String EVIL_PROPERTY= "evil";
- private int rank;
- public static final String RANK_PROPERTY= "rank";
- private int adventureCount;
- public static final String ADVENTURE_COUNT_PROPERTY= "adventureCount";
-
- Person(Crowd crowd, String name) {
- super();
- this.crowd = crowd;
- this.name = name;
- this.birthDate = new Date();
- Calendar c = Calendar.getInstance();
- c.add(Calendar.YEAR, 250);
- this.goneWestDate = new Date(c.getTimeInMillis());
- this.eyeColor = DEFAULT_EYE_COLOR;
- this.evil = false;
- this.rank = 0;
- this.adventureCount = 0;
- }
-
- public static Collection<String> getValidEyeColors() {
- if (validEyeColors == null) {
- validEyeColors = buildValidEyeColors();
- }
- return validEyeColors;
- }
-
- private static Collection<String> buildValidEyeColors() {
- Collection<String> result = new ArrayList<String>();
- result.add(EYE_COLOR_BLUE);
- result.add(EYE_COLOR_GREEN);
- result.add(EYE_COLOR_BROWN);
- result.add(EYE_COLOR_HAZEL);
- result.add(EYE_COLOR_PINK);
- return result;
- }
-
- public Crowd getCrowd() {
- return this.crowd;
- }
-
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- this.crowd.checkPersonName(name);
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Date getBirthDate() {
- return this.birthDate;
- }
- public void setBirthDate(Date birthDate) {
- Object old = this.birthDate;
- this.birthDate = birthDate;
- this.firePropertyChanged(BIRTH_DATE_PROPERTY, old, birthDate);
- }
-
- public Date getGoneWestDate() {
- return this.goneWestDate;
- }
- public void setGoneWestDate(Date goneWestDate) {
- Object old = this.goneWestDate;
- this.goneWestDate = goneWestDate;
- this.firePropertyChanged(GONE_WEST_DATE_PROPERTY, old, goneWestDate);
- }
-
- public String getEyeColor() {
- return this.eyeColor;
- }
- public void setEyeColor(String eyeColor) {
- if (! getValidEyeColors().contains(eyeColor)) {
- throw new IllegalArgumentException(eyeColor);
- }
- Object old = this.eyeColor;
- this.eyeColor = eyeColor;
- this.firePropertyChanged(EYE_COLOR_PROPERTY, old, eyeColor);
- }
-
- public boolean isEvil() {
- return this.evil;
- }
- public void setEvil(boolean evil) {
- boolean old = this.evil;
- this.evil = evil;
- this.firePropertyChanged(EVIL_PROPERTY, old, evil);
- }
-
- public int getRank() {
- return this.rank;
- }
- public void setRank(int rank) {
- int old = this.rank;
- this.rank = rank;
- this.firePropertyChanged(RANK_PROPERTY, old, rank);
- }
-
- public int getAdventureCount() {
- return this.adventureCount;
- }
- public void setAdventureCount(int adventureCount) {
- int old = this.adventureCount;
- this.adventureCount = adventureCount;
- this.firePropertyChanged(ADVENTURE_COUNT_PROPERTY, old, adventureCount);
- }
-
- public int compareTo(Person p) {
- return this.name.compareToIgnoreCase(p.name);
- }
-
- @Override
- public String toString() {
- return this.name +
- "\tborn: " + DateFormat.getDateInstance().format(this.birthDate) +
- "\tgone west: " + DateFormat.getDateInstance().format(this.goneWestDate) +
- "\teyes: " + this.eyeColor +
- "\tevil: " + this.evil +
- "\trank: " + this.rank +
- "\tadventures: " + this.adventureCount
- ;
- }
-
- }
-
-
- private class TestTableModelListener implements TableModelListener {
- TestTableModelListener() {
- super();
- }
- public void tableChanged(TableModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
deleted file mode 100644
index 8d60845745..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
+++ /dev/null
@@ -1,733 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSpinner;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListSelectionModel;
-import javax.swing.SpinnerModel;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-import javax.swing.text.Document;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.CheckBoxTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.ComboBoxTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.SpinnerTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.TableCellEditorAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.Crowd;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.Person;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.PersonColumnAdapter;
-
-/**
- * an example UI for testing the TableModelAdapter
- * "name" column is read-only text field
- * "birth date" column is date text field
- * "gone west date" column is date spinner
- * "eye color" column is combo-box
- * "evil" column is check box
- * "rank" column is number text field
- * "adventure count" column is number spinner
- *
- * Note that the table model and row selection model share the same
- * list value model (the sorted people adapter)
- */
-public class TableModelAdapterUITest {
- private SimpleCollectionValueModel<Object> eyeColorsHolder; // Object because it adapts to a combo-box
- private WritablePropertyValueModel<Crowd> crowdHolder;
- private WritablePropertyValueModel<Person> selectedPersonHolder;
- private ListValueModel<Person> sortedPeopleAdapter;
- private TableModel tableModel;
- private ObjectListSelectionModel rowSelectionModel;
- private Action removeAction;
- private Action renameAction;
-
- public static void main(String[] args) throws Exception {
- new TableModelAdapterUITest().exec(args);
- }
-
- protected TableModelAdapterUITest() {
- super();
- }
-
- protected void exec(String[] args) throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- this.eyeColorsHolder = this. buildEyeColorCollectionHolder();
- this.crowdHolder = this.buildCrowdHolder();
- this.selectedPersonHolder = this.buildSelectedPersonHolder();
- this.sortedPeopleAdapter = this.buildSortedPeopleAdapter();
- this.tableModel = this.buildTableModel();
- this.rowSelectionModel = this.buildRowSelectionModel();
- this.openWindow();
- }
-
- private SimpleCollectionValueModel<Object> buildEyeColorCollectionHolder() {
- return new SimpleCollectionValueModel<Object>(new ArrayList<Object>(Person.getValidEyeColors()));
- }
-
- private WritablePropertyValueModel<Crowd> buildCrowdHolder() {
- return new SimplePropertyValueModel<Crowd>(this.buildCrowd());
- }
-
- private Crowd buildCrowd() {
- Crowd crowd = new Crowd();
-
- Person p = crowd.addPerson("Bilbo");
- p.setEyeColor(Person.EYE_COLOR_BROWN);
- p.setRank(22);
- p.setAdventureCount(1);
-
- p = crowd.addPerson("Gollum");
- p.setEyeColor(Person.EYE_COLOR_PINK);
- p.setEvil(true);
- p.setRank(2);
- p.setAdventureCount(50);
-
- p = crowd.addPerson("Frodo");
- p.setEyeColor(Person.EYE_COLOR_BLUE);
- p.setRank(34);
- p.setAdventureCount(1);
-
- p = crowd.addPerson("Samwise");
- p.setEyeColor(Person.EYE_COLOR_GREEN);
- p.setRank(19);
- p.setAdventureCount(1);
-
- return crowd;
- }
-
- private WritablePropertyValueModel<Person> buildSelectedPersonHolder() {
- return new SimplePropertyValueModel<Person>();
- }
-
- private ListValueModel<Person> buildSortedPeopleAdapter() {
- return new SortedListValueModelAdapter<Person>(this.buildPeopleNameAdapter());
- }
-
- // the list will need to be re-sorted if a name changes
- private ListValueModel<Person> buildPeopleNameAdapter() {
- return new ItemPropertyListValueModelAdapter<Person>(this.buildPeopleAdapter(), Person.NAME_PROPERTY);
- }
-
- private CollectionValueModel<Person> buildPeopleAdapter() {
- return new CollectionAspectAdapter<Crowd, Person>(this.crowdHolder, Crowd.PEOPLE_COLLECTION) {
- @Override
- protected Iterator<Person> iterator_() {
- return this.subject.people();
- }
- @Override
- protected int size_() {
- return this.subject.peopleSize();
- }
- };
- }
-
- private TableModel buildTableModel() {
- return new TableModelAdapter<Person>(this.sortedPeopleAdapter, this.buildColumnAdapter());
- }
-
- protected ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter();
- }
-
- private ObjectListSelectionModel buildRowSelectionModel() {
- ObjectListSelectionModel rsm = new ObjectListSelectionModel(new ListModelAdapter(this.sortedPeopleAdapter));
- rsm.addListSelectionListener(this.buildRowSelectionListener());
- rsm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- return rsm;
- }
-
- private ListSelectionListener buildRowSelectionListener() {
- return new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()) {
- return;
- }
- TableModelAdapterUITest.this.rowSelectionChanged(e);
- }
- };
- }
-
- void rowSelectionChanged(ListSelectionEvent e) {
- Person selection = (Person) this.rowSelectionModel.selectedValue();
- this.selectedPersonHolder.setValue(selection);
- boolean personSelected = (selection != null);
- this.removeAction.setEnabled(personSelected);
- this.renameAction.setEnabled(personSelected);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(ClassTools.shortClassNameForObject(this));
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setLocation(200, 200);
- window.setSize(600, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTablePane(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTablePane() {
- return new JScrollPane(this.buildTable());
- }
-
- private JTable buildTable() {
- JTable table = new JTable(this.tableModel);
- table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); // see Java bug 5007652
- table.setSelectionModel(this.rowSelectionModel);
- table.setDoubleBuffered(true);
- table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
- int rowHeight = 20; // start with minimum of 20
-
- // gone west column (spinner)
- TableColumn column = table.getColumnModel().getColumn(PersonColumnAdapter.GONE_WEST_DATE_COLUMN);
- SpinnerTableCellRenderer spinnerRenderer = this.buildDateSpinnerRenderer();
- column.setCellRenderer(spinnerRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildDateSpinnerRenderer()));
- rowHeight = Math.max(rowHeight, spinnerRenderer.preferredHeight());
-
- // eye color column (combo-box)
- // the jdk combo-box renderer looks like a text field
- // until the user starts an edit - use a custom one
- column = table.getColumnModel().getColumn(PersonColumnAdapter.EYE_COLOR_COLUMN);
- ComboBoxTableCellRenderer eyeColorRenderer = this.buildEyeColorComboBoxRenderer();
- column.setCellRenderer(eyeColorRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildEyeColorComboBoxRenderer()));
- rowHeight = Math.max(rowHeight, eyeColorRenderer.preferredHeight());
-
- // evil (check box)
- // the jdk check box renderer and editor suck - use a custom ones
- column = table.getColumnModel().getColumn(PersonColumnAdapter.EVIL_COLUMN);
- CheckBoxTableCellRenderer evilRenderer = new CheckBoxTableCellRenderer();
- column.setCellRenderer(evilRenderer);
- column.setCellEditor(new TableCellEditorAdapter(new CheckBoxTableCellRenderer()));
- rowHeight = Math.max(rowHeight, evilRenderer.preferredHeight());
-
- // adventure count column (spinner)
- column = table.getColumnModel().getColumn(PersonColumnAdapter.ADVENTURE_COUNT_COLUMN);
- spinnerRenderer = this.buildNumberSpinnerRenderer();
- column.setCellRenderer(spinnerRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildNumberSpinnerRenderer()));
- rowHeight = Math.max(rowHeight, spinnerRenderer.preferredHeight());
-
- table.setRowHeight(rowHeight);
- return table;
- }
-
- private SpinnerTableCellRenderer buildDateSpinnerRenderer() {
- return new SpinnerTableCellRenderer(new DateSpinnerModelAdapter(new SimplePropertyValueModel<Object>()));
- }
-
- private SpinnerTableCellRenderer buildNumberSpinnerRenderer() {
- return new SpinnerTableCellRenderer(new NumberSpinnerModelAdapter(new SimplePropertyValueModel<Number>()));
- }
-
- private ComboBoxTableCellRenderer buildEyeColorComboBoxRenderer() {
- return new ComboBoxTableCellRenderer(this.buildReadOnlyEyeColorComboBoxModel(), this.buildEyeColorRenderer());
- }
-
- private ComboBoxModel buildReadOnlyEyeColorComboBoxModel() {
- return new ComboBoxModelAdapter(this.eyeColorsHolder, new SimplePropertyValueModel<Object>());
- }
-
- private ListCellRenderer buildEyeColorRenderer() {
- return new EyeColorRenderer();
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(0, 1));
- controlPanel.add(this.buildButtonPanel());
- controlPanel.add(this.buildPersonPanel());
- return controlPanel;
- }
-
- private Component buildButtonPanel() {
- JPanel buttonPanel = new JPanel(new GridLayout(1, 0));
- buttonPanel.add(this.buildAddButton());
- buttonPanel.add(this.buildRemoveButton());
- buttonPanel.add(this.buildRenameButton());
- buttonPanel.add(this.buildAddEyeColorButton());
- buttonPanel.add(this.buildPrintButton());
- buttonPanel.add(this.buildResetButton());
- return buttonPanel;
- }
-
- private Component buildPersonPanel() {
- JPanel personPanel = new JPanel(new GridLayout(1, 0));
- personPanel.add(this.buildNameTextField());
- personPanel.add(this.buildBirthDateSpinner());
- personPanel.add(this.buildGoneWestDateSpinner());
- personPanel.add(this.buildEyeColorComboBox());
- personPanel.add(this.buildEvilCheckBox());
- personPanel.add(this.buildRankSpinner());
- personPanel.add(this.buildAdventureCountSpinner());
- return personPanel;
- }
-
-
- // ********** add button **********
-
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.addPerson();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addPerson() {
- String name = this.getNameFromUser();
- if (name != null) {
- this.setSelectedPerson(this.crowd().addPerson(name));
- }
- }
-
-
- // ********** remove button **********
-
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- this.removeAction = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.removePerson();
- }
- };
- this.removeAction.setEnabled(false);
- return this.removeAction;
- }
-
- void removePerson() {
- Person person = this.selectedPerson();
- if (person != null) {
- this.crowd().removePerson(person);
- }
- }
-
-
- // ********** rename button **********
-
- private JButton buildRenameButton() {
- return new JButton(this.buildRenameAction());
- }
-
- private Action buildRenameAction() {
- this.renameAction = new AbstractAction("rename") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.renamePerson();
- }
- };
- this.renameAction.setEnabled(false);
- return this.renameAction;
- }
-
- void renamePerson() {
- Person person = this.selectedPerson();
- if (person != null) {
- String name = this.promptUserForName(person.getName());
- if (name != null) {
- person.setName(name);
- this.setSelectedPerson(person);
- }
- }
- }
-
-
- // ********** add eye color button **********
-
- private JButton buildAddEyeColorButton() {
- return new JButton(this.buildAddEyeColorAction());
- }
-
- private Action buildAddEyeColorAction() {
- Action action = new AbstractAction("add eye color") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.addEyeColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addEyeColor() {
- String color = this.promptUserForEyeColor();
- if (color != null) {
- this.eyeColorsHolder.add(color);
- }
- }
-
- private String promptUserForEyeColor() {
- while (true) {
- String eyeColor = JOptionPane.showInputDialog("Eye Color");
- if (eyeColor == null) {
- return null; // user pressed <Cancel>
- }
- if ((eyeColor.length() == 0)) {
- JOptionPane.showMessageDialog(null, "The eye color is required.", "Invalid Eye Color", JOptionPane.ERROR_MESSAGE);
- } else if (CollectionTools.contains(this.eyeColorsHolder.iterator(), eyeColor)) {
- JOptionPane.showMessageDialog(null, "The eye color already exists.", "Invalid Eye Color", JOptionPane.ERROR_MESSAGE);
- } else {
- return eyeColor;
- }
- }
- }
-
-
- // ********** print button **********
-
- private JButton buildPrintButton() {
- return new JButton(this.buildPrintAction());
- }
-
- private Action buildPrintAction() {
- Action action = new AbstractAction("print") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.printCrowd();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printCrowd() {
- System.out.println(this.crowd());
- for (Iterator<Person> stream = this.crowd().people(); stream.hasNext(); ) {
- System.out.println("\t" + stream.next());
- }
- }
-
-
- // ********** reset button **********
-
- private JButton buildResetButton() {
- return new JButton(this.buildResetAction());
- }
-
- private Action buildResetAction() {
- Action action = new AbstractAction("reset") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.reset();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void reset() {
- this.crowdHolder.setValue(this.buildCrowd());
- }
-
-
- // ********** new name dialog **********
-
- private String getNameFromUser() {
- return this.promptUserForName(null);
- }
-
- private String promptUserForName(String originalName) {
- while (true) {
- String name = JOptionPane.showInputDialog("Person Name");
- if (name == null) {
- return null; // user pressed <Cancel>
- }
- if ((name.length() == 0)) {
- JOptionPane.showMessageDialog(null, "The name is required.", "Invalid Name", JOptionPane.ERROR_MESSAGE);
- } else if (CollectionTools.contains(this.crowd().peopleNames(), name)) {
- JOptionPane.showMessageDialog(null, "The name already exists.", "Invalid Name", JOptionPane.ERROR_MESSAGE);
- } else {
- return name;
- }
- }
- }
-
-
- // ********** name text field **********
-
- private Component buildNameTextField() {
- JTextField textField = new JTextField(this.buildNameDocument(), null, 0);
- textField.setEditable(false);
- return textField;
- }
-
- private Document buildNameDocument() {
- return new DocumentAdapter(this.buildNameAdapter());
- }
-
- private WritablePropertyValueModel<String> buildNameAdapter() {
- return new PropertyAspectAdapter<Person, String>(this.selectedPersonHolder, Person.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
-
- // ********** birth date spinner **********
-
- private JSpinner buildBirthDateSpinner() {
- return new JSpinner(this.buildBirthDateSpinnerModel());
- }
-
- private SpinnerModel buildBirthDateSpinnerModel() {
- return new DateSpinnerModelAdapter(this.buildBirthDateAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.BIRTH_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
-
- // ********** gone west date spinner **********
-
- private JSpinner buildGoneWestDateSpinner() {
- return new JSpinner(this.buildGoneWestDateSpinnerModel());
- }
-
- private SpinnerModel buildGoneWestDateSpinnerModel() {
- return new DateSpinnerModelAdapter(this.buildGoneWestDateAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildGoneWestDateAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.GONE_WEST_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getGoneWestDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setGoneWestDate((Date) value);
- }
- };
- }
-
-
- // ********** eye color combo-box **********
-
- private JComboBox buildEyeColorComboBox() {
- return new JComboBox(this.buildEyeColorComboBoxModel());
- }
-
- private ComboBoxModel buildEyeColorComboBoxModel() {
- return new ComboBoxModelAdapter(this.eyeColorsHolder, this.buildEyeColorAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.EYE_COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
-
- // ********** evil check box **********
-
- private JCheckBox buildEvilCheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("evil");
- checkBox.setModel(this.buildEvilCheckBoxModel());
- return checkBox;
- }
-
- private ButtonModel buildEvilCheckBoxModel() {
- return new CheckBoxModelAdapter(this.buildEvilAdapter());
- }
-
- private WritablePropertyValueModel<Boolean> buildEvilAdapter() {
- return new PropertyAspectAdapter<Person, Boolean>(this.selectedPersonHolder, Person.EVIL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isEvil());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setEvil(value.booleanValue());
- }
- };
- }
-
-
- // ********** rank spinner **********
-
- private JSpinner buildRankSpinner() {
- return new JSpinner(this.buildRankSpinnerModel());
- }
-
- private SpinnerModel buildRankSpinnerModel() {
- return new NumberSpinnerModelAdapter(this.buildRankAdapter());
- }
-
- private WritablePropertyValueModel<Number> buildRankAdapter() {
- return new PropertyAspectAdapter<Person, Number>(this.selectedPersonHolder, Person.RANK_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getRank());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setRank(value.intValue());
- }
- };
- }
-
-
- // ********** adventure count spinner **********
-
- private JSpinner buildAdventureCountSpinner() {
- return new JSpinner(this.buildAdventureCountSpinnerModel());
- }
-
- private SpinnerModel buildAdventureCountSpinnerModel() {
- return new NumberSpinnerModelAdapter(this.buildAdventureCountAdapter());
- }
-
- private WritablePropertyValueModel<Number> buildAdventureCountAdapter() {
- return new PropertyAspectAdapter<Person, Number>(this.selectedPersonHolder, Person.ADVENTURE_COUNT_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getAdventureCount());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setAdventureCount(value.intValue());
- }
- };
- }
-
-
- // ********** queries **********
-
- private Crowd crowd() {
- return this.crowdHolder.getValue();
- }
-
- private Person selectedPerson() {
- if (this.rowSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return (Person) this.rowSelectionModel.selectedValue();
- }
-
- private void setSelectedPerson(Person person) {
- this.rowSelectionModel.setSelectedValue(person);
- }
-
-
- // ********** custom renderer **********
-
- /**
- * This is simply an example of a renderer for the embedded combo-box.
- * It does nothing special unless you uncomment the code below....
- */
- private class EyeColorRenderer extends DefaultListCellRenderer {
- EyeColorRenderer() {
- super();
- }
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- // just do something to show the renderer is working...
- // value = ">" + value;
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
deleted file mode 100644
index 91aa582d85..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
+++ /dev/null
@@ -1,817 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.AbstractTreeNodeValueModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-public class TreeModelAdapterTests extends TestCase {
- boolean eventFired;
-
- public TreeModelAdapterTests(String name) {
- super(name);
- }
-
- public void testGetRoot() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- assertEquals("root", root.getName());
-// root.dump();
-// rootNode.dump();
- }
-
- public void testGetChild() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- TestNode expected = rootNode.childNamed("node 1");
- TestNode actual = (TestNode) treeModel.getChild(rootNode, 1);
- assertEquals(expected, actual);
-
- expected = rootNode.childNamed("node 2");
- actual = (TestNode) treeModel.getChild(rootNode, 2);
- assertEquals(expected, actual);
- }
-
- public void testGetChildCount() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- assertEquals(5, treeModel.getChildCount(rootNode));
-
- TestNode node = rootNode.childNamed("node 1");
- assertEquals(1, treeModel.getChildCount(node));
- }
-
- public void testGetIndexOfChild() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- TestNode child = rootNode.childNamed("node 0");
- assertEquals(0, treeModel.getIndexOfChild(rootNode, child));
-
- child = rootNode.childNamed("node 1");
- assertEquals(1, treeModel.getIndexOfChild(rootNode, child));
-
- child = rootNode.childNamed("node 2");
- assertEquals(2, treeModel.getIndexOfChild(rootNode, child));
- TestNode grandchild = child.childNamed("node 2.2");
- assertEquals(2, treeModel.getIndexOfChild(child, grandchild));
- }
-
- public void testIsLeaf() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
- assertFalse(treeModel.isLeaf(rootNode));
- TestNode node = rootNode.childNamed("node 1");
- assertFalse(treeModel.isLeaf(node));
- node = rootNode.childNamed("node 3");
- assertTrue(treeModel.isLeaf(node));
- }
-
-
- public void testTreeNodesChanged() {
- // the only way to trigger a "node changed" event is to use an unsorted tree;
- // a sorted tree will will trigger only "node removed" and "node inserted" events
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesChanged(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestNode node = rootNode.childNamed("node 1");
- TestModel tm = node.getTestModel();
- tm.setName("node 1++");
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- node = node.childNamed("node 1.1");
- tm = node.getTestModel();
- tm.setName("node 1.1++");
- assertTrue(this.eventFired);
- }
-
- public void testTreeNodesInserted() {
- // use an unsorted tree so the nodes are not re-shuffled...
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestNode node = rootNode.childNamed("node 1");
- TestModel tm = node.getTestModel();
- tm.addChild("new child...");
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- node = node.childNamed("node 1.1");
- tm = node.getTestModel();
- tm.addChild("another new child...");
- assertTrue(this.eventFired);
- }
-
- public void testTreeNodesRemoved() {
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- root.removeChild(root.childNamed("node 3"));
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- TestNode node = rootNode.childNamed("node 2");
- TestModel tm = node.getTestModel();
- tm.removeChild(tm.childNamed("node 2.2"));
- assertTrue(this.eventFired);
- }
-
- public void testTreeStructureChanged() {
- WritablePropertyValueModel<TreeNodeValueModel<Object>> nodeHolder = new SimplePropertyValueModel<TreeNodeValueModel<Object>>(this.buildSortedRootNode());
- TreeModel treeModel = this.buildTreeModel(nodeHolder);
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- // do nothing
- }
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- // do nothing
- }
- @Override
- public void treeStructureChanged(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- nodeHolder.setValue(this.buildUnsortedRootNode());
- assertTrue(this.eventFired);
- }
-
- /**
- * test a problem we had where removing a child from a tree would cause
- * the JTree to call #equals(Object) on each node removed (actually, it was
- * TreePath, but that was because its own #equals(Object) was called by
- * JTree); and since we had already removed the last listener from the
- * aspect adapter, the aspect adapter would say its value was null; this
- * would cause a NPE until we tweaked TreeModelAdapter to remove its
- * listeners from a node only *after* the node had been completely
- * removed from the JTree
- * @see TreeModelAdapter#removeNode(Object[], int, TreeNodeValueModel)
- * @see TreeModelAdapter#addNode(Object[], int, TreeNodeValueModel)
- */
- public void testLazyInitialization() {
- TreeModel treeModel = this.buildSpecialTreeModel();
- JTree jTree = new JTree(treeModel);
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- // this would cause a NPE:
- root.removeChild(root.childNamed("node 3"));
- assertEquals(treeModel, jTree.getModel());
- }
-
-
- private TreeModel buildSortedTreeModel() {
- return this.buildTreeModel(this.buildSortedRootNode());
- }
-
- private TestNode buildSortedRootNode() {
- return new SortedTestNode(this.buildRoot());
- }
-
- private TreeModel buildUnsortedTreeModel() {
- return this.buildTreeModel(this.buildUnsortedRootNode());
- }
-
- private TestNode buildUnsortedRootNode() {
- return new UnsortedTestNode(this.buildRoot());
- }
-
- private TreeModel buildSpecialTreeModel() {
- return this.buildTreeModel(this.buildSpecialRootNode());
- }
-
- private TestNode buildSpecialRootNode() {
- return new SpecialTestNode(this.buildRoot());
- }
-
- private TestModel buildRoot() {
- TestModel root = new TestModel("root");
- /*Node node_0 = */root.addChild("node 0");
- TestModel node_1 = root.addChild("node 1");
- TestModel node_1_1 = node_1.addChild("node 1.1");
- /*Node node_1_1_1 = */node_1_1.addChild("node 1.1.1");
- TestModel node_2 = root.addChild("node 2");
- /*Node node_2_0 = */node_2.addChild("node 2.0");
- /*Node node_2_1 = */node_2.addChild("node 2.1");
- /*Node node_2_2 = */node_2.addChild("node 2.2");
- /*Node node_2_3 = */node_2.addChild("node 2.3");
- /*Node node_2_4 = */node_2.addChild("node 2.4");
- /*Node node_2_5 = */node_2.addChild("node 2.5");
- /*Node node_3 = */root.addChild("node 3");
- /*Node node_4 = */root.addChild("node 4");
- return root;
- }
-
-
- // ********** member classes **********
-
- /**
- * This is a typical model class with the typical change notifications
- * for #name and #children.
- */
- public static class TestModel extends AbstractModel {
-
- // the parent is immutable; the root's parent is null
- private final TestModel parent;
-
- // the name is mutable; so I guess it isn't the "primary key" :-)
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- private final Collection<TestModel> children;
- public static final String CHILDREN_COLLECTION = "children";
-
-
- public TestModel(String name) { // root ctor
- this(null, name);
- }
- private TestModel(TestModel parent, String name) {
- super();
- this.parent = parent;
- this.name = name;
- this.children = new HashBag<TestModel>();
- }
-
- public TestModel getParent() {
- return this.parent;
- }
-
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<TestModel> children() {
- return new ReadOnlyIterator<TestModel>(this.children);
- }
- public int childrenSize() {
- return this.children.size();
- }
- public TestModel addChild(String childName) {
- TestModel child = new TestModel(this, childName);
- this.addItemToCollection(child, this.children, CHILDREN_COLLECTION);
- return child;
- }
- public TestModel[] addChildren(String[] childNames) {
- TestModel[] newChildren = new TestModel[childNames.length];
- for (int i = 0; i < childNames.length; i++) {
- newChildren[i] = new TestModel(this, childNames[i]);
- }
- this.addItemsToCollection(newChildren, this.children, CHILDREN_COLLECTION);
- return newChildren;
- }
- public void removeChild(TestModel child) {
- this.removeItemFromCollection(child, this.children, CHILDREN_COLLECTION);
- }
- public void removeChildren(TestModel[] testModels) {
- this.removeItemsFromCollection(testModels, this.children, CHILDREN_COLLECTION);
- }
- public void clearChildren() {
- this.clearCollection(this.children, CHILDREN_COLLECTION);
- }
- public TestModel childNamed(String childName) {
- for (TestModel child : this.children) {
- if (child.getName().equals(childName)) {
- return child;
- }
- }
- throw new RuntimeException("child not found: " + childName);
- }
-
- public String dumpString() {
- StringWriter sw = new StringWriter();
- IndentingPrintWriter ipw = new IndentingPrintWriter(sw);
- this.dumpOn(ipw);
- return sw.toString();
- }
- public void dumpOn(IndentingPrintWriter writer) {
- writer.println(this);
- writer.indent();
- for (TestModel child : this.children) {
- child.dumpOn(writer);
- }
- writer.undent();
- }
- public void dumpOn(OutputStream stream) {
- IndentingPrintWriter writer = new IndentingPrintWriter(new OutputStreamWriter(stream));
- this.dumpOn(writer);
- writer.flush();
- }
- public void dump() {
- this.dumpOn(System.out);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.name);
- }
-
- }
-
-
- /**
- * This Node wraps a TestModel and converts into something that can
- * be used by TreeModelAdapter. It converts changes to the TestModel's
- * name into "state changes" to the Node; and converts the
- * TestModel's children into a ListValueModel of Nodes whose order is
- * determined by subclass implementations.
- */
- public static abstract class TestNode extends AbstractTreeNodeValueModel<Object> implements Displayable {
- /** the model object wrapped by this node */
- private final TestModel testModel;
- /** this node's parent node; null for the root node */
- private final TestNode parent;
- /** this node's child nodes */
- private final ListValueModel<TreeNodeValueModel<Object>> childrenModel;
- /** a listener that notifies us when the model object's "internal state" changes */
- private final PropertyChangeListener testModelListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * root node constructor
- */
- public TestNode(TestModel testModel) {
- this(null, testModel);
- }
-
- /**
- * branch or leaf node constructor
- */
- public TestNode(TestNode parent, TestModel testModel) {
- super();
- this.parent = parent;
- this.testModel = testModel;
- this.childrenModel = this.buildChildrenModel(testModel);
- this.testModelListener = this.buildTestModelListener();
- }
-
- private PropertyChangeListener buildTestModelListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TestNode.this.testModelChanged(e);
- }
- };
- }
-
- /**
- * subclasses decide the order of the child nodes
- */
- protected abstract ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel model);
-
- /**
- * used by subclasses;
- * transform the test model children into nodes
- */
- protected ListValueModel<TreeNodeValueModel<Object>> buildNodeAdapter(TestModel model) {
- return new TransformationListValueModelAdapter<TestModel, TreeNodeValueModel<Object>>(this.buildChildrenAdapter(model)) {
- @Override
- protected TestNode transformItem(TestModel item) {
- return TestNode.this.buildChildNode(item);
- }
- };
- }
-
- /**
- * subclasses must build a concrete node for the specified test model
- */
- protected abstract TestNode buildChildNode(TestModel childTestModel);
-
- /**
- * return a collection value model on the specified model's children
- */
- protected CollectionValueModel<TestModel> buildChildrenAdapter(TestModel model) {
- return new CollectionAspectAdapter<TestModel, TestModel>(TestModel.CHILDREN_COLLECTION, model) {
- @Override
- protected Iterator<TestModel> iterator_() {
- return this.subject.children();
- }
- @Override
- protected int size_() {
- return this.subject.childrenSize();
- }
- };
- }
-
-
- // ********** TreeNodeValueModel implementation **********
-
- public TestModel getValue() {
- return this.testModel;
- }
-
- public TreeNodeValueModel<Object> parent() {
- return this.parent;
- }
-
- public ListValueModel<TreeNodeValueModel<Object>> childrenModel() {
- return this.childrenModel;
- }
-
-
- // ********** AbstractTreeNodeValueModel implementation **********
-
- @Override
- protected void engageValue() {
- this.testModel.addPropertyChangeListener(TestModel.NAME_PROPERTY, this.testModelListener);
- }
-
- @Override
- protected void disengageValue() {
- this.testModel.removePropertyChangeListener(TestModel.NAME_PROPERTY, this.testModelListener);
- }
-
-
- // ********** Displayable implementation **********
-
- public String displayString() {
- return this.testModel.getName();
- }
-
- public Icon icon() {
- return null;
- }
-
-
- // ********** debugging support **********
-
- public String dumpString() {
- StringWriter sw = new StringWriter();
- IndentingPrintWriter ipw = new IndentingPrintWriter(sw);
- this.dumpOn(ipw);
- return sw.toString();
- }
-
- public void dumpOn(IndentingPrintWriter writer) {
- writer.println(this);
- writer.indent();
- for (Iterator<TreeNodeValueModel<Object>> stream = this.childrenModel.iterator(); stream.hasNext(); ) {
- // cast to a TestNode (i.e. this won't work with a NameTestNode in the tree)
- ((TestNode) stream.next()).dumpOn(writer);
- }
- writer.undent();
- }
-
- public void dumpOn(OutputStream stream) {
- IndentingPrintWriter writer = new IndentingPrintWriter(new OutputStreamWriter(stream));
- this.dumpOn(writer);
- writer.flush();
- }
-
- public void dump() {
- this.dumpOn(System.out);
- }
-
-
- // ********** behavior **********
-
- /**
- * the model's name has changed, forward the event to our listeners
- */
- protected void testModelChanged(PropertyChangeEvent e) {
- // we need to notify listeners that our "internal state" has changed
- this.fireStateChanged();
- // our display string stays in synch with the model's name
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, e.getOldValue(), e.getNewValue());
- }
-
-
- // ********** queries **********
-
- public TestModel getTestModel() {
- return this.testModel;
- }
-
- /**
- * testing convenience method
- */
- public TestNode childNamed(String name) {
- for (Iterator<TreeNodeValueModel<Object>> stream = this.childrenModel.iterator(); stream.hasNext(); ) {
- TreeNodeValueModel<Object> childNode = stream.next();
- if (childNode instanceof TestNode) {
- if (((TestNode) childNode).getTestModel().getName().equals(name)) {
- return (TestNode) childNode;
- }
- }
- }
- throw new IllegalArgumentException("child not found: " + name);
- }
-
-
- // ********** standard methods **********
-
- /**
- * use the standard Displayable comparator
- */
- public int compareTo(Displayable d) {
- return DEFAULT_COMPARATOR.compare(this, d);
- }
-
- @Override
- public String toString() {
- return "Node(" + this.testModel + ")";
- }
-
- }
-
- /**
- * concrete implementation that keeps its children sorted
- */
- public static class SortedTestNode extends TestNode {
-
- // ********** constructors **********
- public SortedTestNode(TestModel testModel) {
- super(testModel);
- }
- public SortedTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** the list should be sorted */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- return new SortedListValueModelAdapter<TreeNodeValueModel<Object>>(this.buildDisplayStringAdapter(testModel));
- }
- /** the display string (name) of each node can change */
- protected ListValueModel<TreeNodeValueModel<Object>> buildDisplayStringAdapter(TestModel testModel) {
- return new ItemPropertyListValueModelAdapter<TreeNodeValueModel<Object>>(this.buildNodeAdapter(testModel), DISPLAY_STRING_PROPERTY);
- }
- /** children are also sorted nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new SortedTestNode(this, childNode);
- }
-
- }
-
-
- /**
- * concrete implementation that leaves its children unsorted
- */
- public static class UnsortedTestNode extends TestNode {
-
- // ********** constructors **********
- public UnsortedTestNode(TestModel testModel) {
- super(testModel);
- }
- public UnsortedTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** the list should NOT be sorted */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- return this.buildNodeAdapter(testModel);
- }
- /** children are also unsorted nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new UnsortedTestNode(this, childNode);
- }
-
- }
-
-
- /**
- * concrete implementation that leaves its children unsorted
- * and has a special set of children for "node 3"
- */
- public static class SpecialTestNode extends UnsortedTestNode {
-
- // ********** constructors **********
- public SpecialTestNode(TestModel testModel) {
- super(testModel);
- }
- public SpecialTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** return a different list of children for "node 3" */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- if (testModel.getName().equals("node 3")) {
- return this.buildSpecialChildrenModel(testModel);
- }
- return super.buildChildrenModel(testModel);
- }
- protected ListValueModel<TreeNodeValueModel<Object>> buildSpecialChildrenModel(TestModel testModel) {
- TreeNodeValueModel<Object>[] children = new NameTestNode[1];
- children[0] = new NameTestNode(this);
- return new SimpleListValueModel<TreeNodeValueModel<Object>>(Arrays.asList(children));
- }
- /** children are also special nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new SpecialTestNode(this, childNode);
- }
-
- }
-
-
- public static class NameTestNode extends AbstractTreeNodeValueModel<Object> {
- private final WritablePropertyValueModel<String> nameAdapter;
- private final SpecialTestNode specialNode; // parent node
- private final PropertyChangeListener nameListener;
- private final ListValueModel<TreeNodeValueModel<Object>> childrenModel;
-
- // ********** construction/initialization **********
-
- public NameTestNode(SpecialTestNode specialNode) {
- super();
- this.nameListener = this.buildNameListener();
- this.specialNode = specialNode;
- this.nameAdapter = this.buildNameAdapter();
- this.childrenModel = new NullListValueModel<TreeNodeValueModel<Object>>();
- }
- protected PropertyChangeListener buildNameListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- NameTestNode.this.nameChanged(e);
- }
- };
- }
- protected WritablePropertyValueModel<String> buildNameAdapter() {
- return new PropertyAspectAdapter<TestModel, String>(TestModel.NAME_PROPERTY, this.getTestModel()) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- public TestModel getTestModel() {
- return this.specialNode.getTestModel();
- }
-
- // ********** TreeNodeValueModel implementation **********
-
- public String getValue() {
- return this.nameAdapter.getValue();
- }
- @Override
- public void setValue(Object value) {
- this.nameAdapter.setValue((String) value);
- }
- public TreeNodeValueModel<Object> parent() {
- return this.specialNode;
- }
- public ListValueModel<TreeNodeValueModel<Object>> childrenModel() {
- return this.childrenModel;
- }
-
- // ********** AbstractTreeNodeValueModel implementation **********
-
- @Override
- protected void engageValue() {
- this.nameAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.nameListener);
- }
- @Override
- protected void disengageValue() {
- this.nameAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.nameListener);
- }
-
- // ********** behavior **********
-
- protected void nameChanged(PropertyChangeEvent e) {
- // we need to notify listeners that our "value" has changed
- this.firePropertyChanged(VALUE, e.getOldValue(), e.getNewValue());
- }
- }
-
- private TreeModel buildTreeModel(TestNode root) {
- return this.buildTreeModel(new StaticPropertyValueModel<TreeNodeValueModel<Object>>(root));
- }
-
- private TreeModel buildTreeModel(PropertyValueModel<TreeNodeValueModel<Object>> rootHolder) {
- return new TreeModelAdapter<Object>(rootHolder) {
- @Override
- protected ListChangeListener buildChildrenListener() {
- return this.buildChildrenListener_();
- }
- @Override
- protected StateChangeListener buildNodeStateListener() {
- return this.buildNodeStateListener_();
- }
- @Override
- protected PropertyChangeListener buildNodeValueListener() {
- return this.buildNodeValueListener_();
- }
- @Override
- protected PropertyChangeListener buildRootListener() {
- return this.buildRootListener_();
- }
- };
- }
-
-
-
- /**
- * listener that will blow up with any event;
- * override and implement expected event methods
- */
- public class TestTreeModelListener implements TreeModelListener {
- public void treeNodesChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesInserted(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesRemoved(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeStructureChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
deleted file mode 100644
index be2c5b252d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.WindowConstants;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.DefaultTreeSelectionModel;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EnumerationIterator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.SortedTestNode;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestNode;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.UnsortedTestNode;
-
-/**
- * an example UI for testing the TreeModelAdapter
- */
-public class TreeModelAdapterUITest {
-
- // hold the tree so we can restore its expansion state
- private JTree tree;
- private WritablePropertyValueModel<TreeNodeValueModel<Object>> rootNodeHolder;
- private boolean sorted;
- private TreeModel treeModel;
- private TreeSelectionModel treeSelectionModel;
- private TextField nameTextField;
-
- public static void main(String[] args) throws Exception {
- new TreeModelAdapterUITest().exec(args);
- }
-
- private TreeModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.rootNodeHolder = this.buildRootNodeHolder();
- this.sorted = this.rootNodeHolder.getValue() instanceof SortedTestNode;
- this.treeModel = this.buildTreeModel();
- this.treeSelectionModel = this.buildTreeSelectionModel();
- this.nameTextField = new TextField();
- this.openWindow();
- }
-
- private WritablePropertyValueModel<TreeNodeValueModel<Object>> buildRootNodeHolder() {
- return new SimplePropertyValueModel<TreeNodeValueModel<Object>>(this.buildSortedRootNode());
- }
-
- private TestNode buildSortedRootNode() {
- return new SortedTestNode(this.buildRoot());
- }
-
- private TestNode buildUnsortedRootNode() {
- return new UnsortedTestNode(this.buildRoot());
- }
-
- private TestModel buildRoot() {
- TestModel root = new TestModel("root");
-
- TestModel node_1 = root.addChild("node 1");
- /*Node node_1_1 = */node_1.addChild("node 1.1");
-
- TestModel node_2 = root.addChild("node 2");
- /*Node node_2_1 = */node_2.addChild("node 2.1");
- TestModel node_2_2 = node_2.addChild("node 2.2");
- /*Node node_2_2_1 = */node_2_2.addChild("node 2.2.1");
- /*Node node_2_2_2 = */node_2_2.addChild("node 2.2.2");
- /*Node node_2_3 = */node_2.addChild("node 2.3");
- /*Node node_2_4 = */node_2.addChild("node 2.4");
- /*Node node_2_5 = */node_2.addChild("node 2.5");
-
- TestModel node_3 = root.addChild("node 3");
- TestModel node_3_1 = node_3.addChild("node 3.1");
- TestModel node_3_1_1 = node_3_1.addChild("node 3.1.1");
- /*Node node_3_1_1_1 = */node_3_1_1.addChild("node 3.1.1.1");
-
- /*Node node_4 = */root.addChild("node 4");
-
- return root;
- }
-
- private TreeModel buildTreeModel() {
- return new TreeModelAdapter<Object>(this.rootNodeHolder);
- }
-
- private TreeSelectionModel buildTreeSelectionModel() {
- TreeSelectionModel tsm = new DefaultTreeSelectionModel();
- tsm.addTreeSelectionListener(this.buildTreeSelectionListener());
- tsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
- return tsm;
- }
-
- private TreeSelectionListener buildTreeSelectionListener() {
- return new TreeSelectionListener() {
- public void valueChanged(TreeSelectionEvent e) {
- TreeModelAdapterUITest.this.treeSelectionChanged(e);
- }
- };
- }
-
- void treeSelectionChanged(TreeSelectionEvent e) {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- this.nameTextField.setText(selectedTestModel.getName());
- }
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setLocation(300, 300);
- window.setSize(400, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTreePane(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTreePane() {
- return new JScrollPane(this.buildTree());
- }
-
- private JTree buildTree() {
- this.tree = new JTree(this.treeModel) {
- @Override
- public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
- return ((Displayable) value).displayString();
- }
- };
- this.tree.setSelectionModel(this.treeSelectionModel);
- this.tree.setRootVisible(true);
- this.tree.setShowsRootHandles(true);
- this.tree.setRowHeight(20);
- this.tree.setDoubleBuffered(true);
- return this.tree;
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(0, 1));
- controlPanel.add(this.buildAddRenameNodePanel());
- controlPanel.add(this.buildMiscPanel());
- return controlPanel;
- }
-
- private Component buildAddRenameNodePanel() {
- JPanel addRenameNodePanel = new JPanel(new BorderLayout());
- addRenameNodePanel.add(this.buildAddButton(), BorderLayout.WEST);
- addRenameNodePanel.add(this.nameTextField, BorderLayout.CENTER);
- addRenameNodePanel.add(this.buildRenameButton(), BorderLayout.EAST);
- return addRenameNodePanel;
- }
-
- private Component buildMiscPanel() {
- JPanel miscPanel = new JPanel(new GridLayout(1, 0));
- miscPanel.add(this.buildClearChildrenButton());
- miscPanel.add(this.buildRemoveButton());
- miscPanel.add(this.buildResetButton());
- return miscPanel;
- }
-
- private String getName() {
- return this.nameTextField.getText();
- }
-
- // ********** queries **********
- private TestNode selectedNode() {
- if (this.treeSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return (TestNode) this.treeSelectionModel.getSelectionPath().getLastPathComponent();
- }
-
- private TestModel selectedTestModel() {
- if (this.treeSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return this.selectedNode().getValue();
- }
-
- private TestNode rootNode() {
- return (TestNode) this.treeModel.getRoot();
- }
-
- private TestModel root() {
- return this.rootNode().getValue();
- }
-
- private Collection<TreePath> expandedPaths() {
- Enumeration<TreePath> stream = this.tree.getExpandedDescendants(new TreePath(this.rootNode()));
- if (stream == null) {
- return Collections.emptyList();
- }
- return CollectionTools.list(new EnumerationIterator<TreePath>(stream));
- }
-
- // ********** behavior **********
- private void setSelectedNode(TestNode selectedNode) {
- this.treeSelectionModel.setSelectionPath(new TreePath(selectedNode.path()));
- }
-
- private void expandPaths(Collection<TreePath> paths) {
- for (TreePath path : paths) {
- this.tree.expandPath(path);
- }
- }
-
- // ********** add **********
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.addNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * adding causes the tree to be sorted and nodes to be
- * removed and re-added; so we have to fiddle with the expansion state
- */
- void addNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- String name = this.getName();
- // save the expansion state and restore it after the add
- Collection<TreePath> paths = this.expandedPaths();
-
- selectedTestModel.addChild(name);
-
- this.expandPaths(paths);
- this.setSelectedNode(this.selectedNode().childNamed(name));
- }
- }
-
- // ********** remove **********
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- Action action = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.removeNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * we need to figure out which node to select after
- * the selected node is deleted
- */
- void removeNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- // do not allow the root to be removed
- if ((selectedTestModel != null) && (selectedTestModel != this.root())) {
- // save the parent and index, so we can select another, nearby, node
- // once the selected node is removed
- TestNode parentNode = (TestNode) this.selectedNode().parent();
- int childIndex = parentNode.indexOfChild(this.selectedNode());
-
- selectedTestModel.getParent().removeChild(selectedTestModel);
-
- int childrenSize = parentNode.childrenSize();
- if (childIndex < childrenSize) {
- // select the child that moved up and replaced the just-deleted child
- this.setSelectedNode((TestNode) parentNode.child(childIndex));
- } else {
- if (childrenSize == 0) {
- // if there are no more children, select the parent
- this.setSelectedNode(parentNode);
- } else {
- // if the child at the bottom of the list was deleted, select the next child up
- this.setSelectedNode((TestNode) parentNode.child(childIndex - 1));
- }
- }
- }
- }
-
- // ********** rename **********
- private JButton buildRenameButton() {
- return new JButton(this.buildRenameAction());
- }
-
- private Action buildRenameAction() {
- Action action = new AbstractAction("rename") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.renameNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * renaming causes the tree to be sorted and nodes to be
- * removed and re-added; so we have to fiddle with the expansion state
- */
- void renameNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- // save the node and re-select it after the rename
- TestNode selectedNode = this.selectedNode();
- // save the expansion state and restore it after the rename
- Collection<TreePath> paths = this.expandedPaths();
-
- selectedTestModel.setName(this.getName());
-
- this.expandPaths(paths);
- this.setSelectedNode(selectedNode);
- }
- }
-
- // ********** clear children **********
- private JButton buildClearChildrenButton() {
- return new JButton(this.buildClearChildrenAction());
- }
-
- private Action buildClearChildrenAction() {
- Action action = new AbstractAction("clear children") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.clearChildren();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * nothing special, we just want to test #fireCollectionChanged(String)
- */
- void clearChildren() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- selectedTestModel.clearChildren();
- }
- }
-
- // ********** reset **********
- private JButton buildResetButton() {
- return new JButton(this.buildResetAction());
- }
-
- private Action buildResetAction() {
- Action action = new AbstractAction("reset") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.reset();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * test the adapter's root node holder;
- * toggle between sorted and unsorted lists
- */
- void reset() {
- this.sorted = ! this.sorted;
- if (this.sorted) {
- this.rootNodeHolder.setValue(this.buildSortedRootNode());
- } else {
- this.rootNodeHolder.setValue(this.buildUnsortedRootNode());
- }
- this.tree.expandPath(new TreePath(this.rootNode()));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java
deleted file mode 100644
index d541d687db..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.node;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.internal.node.Problem;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class AbstractNodeTests extends TestCase {
- private TestWorkbenchModel root;
-
- public AbstractNodeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.root = this.buildRoot();
- }
-
- private TestWorkbenchModel buildRoot() {
- TestWorkbenchModel r = new RootTestWorkbenchModel("root");
- TestWorkbenchModel node1 = r.addTestChildNamed("node 1");
- TestWorkbenchModel node1_1 = node1.addTestChildNamed("node 1.1");
- node1_1.addTestChildNamed("node 1.1.1");
- node1_1.addTestChildNamed("node 1.1.2");
- node1_1.addTestChildNamed("node 1.1.3");
- node1.addTestChildNamed("node 1.2");
- TestWorkbenchModel node2 = r.addTestChildNamed("node 2");
- node2.addTestChildNamed("node 2.1");
- node2.addTestChildNamed("node 2.2");
- r.addTestChildNamed("node 3");
- r.addTestChildNamed("node 4");
-
- // mark the entire tree clean
- r.markEntireBranchClean();
- return r;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testTestWorkbenchModel() {
- // make sure our test class works OK...
- assertNull(this.root.testChildNamed(""));
- assertNotNull(this.root.testChildNamed("node 1"));
- assertTrue(this.root.testChildNamed("node 1").isClean());
- assertTrue(this.root.testChildNamed("node 1").isCleanBranch());
- assertNotNull(this.root.testChildNamed("node 2"));
- assertTrue(this.root.testChildNamed("node 2").isClean());
- assertTrue(this.root.testChildNamed("node 2").isCleanBranch());
- assertNull(this.root.testChildNamed("node 2.1"));
-
- assertNull(this.root.testDescendantNamed(""));
- assertNotNull(this.root.testDescendantNamed("node 1"));
- assertNotNull(this.root.testDescendantNamed("node 2"));
- assertNotNull(this.root.testDescendantNamed("node 2.1"));
- assertTrue(this.root.testDescendantNamed("node 2.1").isClean());
- assertTrue(this.root.testDescendantNamed("node 2.1").isCleanBranch());
- assertNotNull(this.root.testDescendantNamed("node 1.1.3"));
- assertTrue(this.root.testDescendantNamed("node 1.1.3").isClean());
- assertTrue(this.root.testDescendantNamed("node 1.1.3").isCleanBranch());
- }
-
- public void testParentAndChildren() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- assertEquals("node 1.1.3", node.getName());
- assertEquals(0, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertEquals("node 1.1", node.getName());
- assertEquals(3, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertEquals("node 1", node.getName());
- assertEquals(2, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertEquals("root", node.getName());
- assertEquals(4, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertNull(node);
- }
-
- public void testDirty() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirty());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
- }
-
- public void testDirtyUnchangedAttribute() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirty());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
-
- this.root.markEntireBranchClean();
- // set size to same number - should stay clean
- node.setSize(42);
- assertTrue(node.isClean());
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
- }
-
- public void testDirtyBranch() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirtyBranch());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isDirtyBranch());
-
- parent.setSize(77);
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
-
- node.markEntireBranchClean();
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchCleanChildDirtyParent() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setSize(77);
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
-
- // now, clean the child, but leave the parent dirty
- node.markEntireBranchClean();
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchCleanChildDirtyChild() {
- TestWorkbenchModel node1 = this.root.testDescendantNamed("node 1.1.1");
- node1.setSize(41);
- TestWorkbenchModel node2 = this.root.testDescendantNamed("node 1.1.2");
- node2.setSize(42);
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node1.getParent();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
-
- // now, clean the first child, but leave the second child dirty
- node1.markEntireBranchClean();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchForced() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
-
- assertTrue(node.isClean());
- assertTrue(node.isCleanBranch());
- assertTrue(parent.isClean());
- assertTrue(parent.isCleanBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isCleanBranch());
-
- this.root.markEntireBranchDirty();
-
- assertTrue(node.isDirty());
- assertTrue(node.isDirtyBranch());
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isDirty());
- assertTrue(this.root.isDirtyBranch());
- }
-
- public void testDirtyTransientAttribute() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- assertTrue(node.isDirty());
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isDirtyBranch());
-
- this.root.markEntireBranchClean();
-
- this.root.validateBranch();
-
- assertTrue(this.root.problemsSize() == 0);
- assertTrue(node.branchProblems().hasNext());
- assertTrue(parent.problemsSize() == 0);
- assertTrue(parent.branchProblems().hasNext());
- assertTrue(node.problemsSize() > 0);
-
- // since problems are transient, everything should still be clean
- assertTrue(node.isClean());
- assertTrue(node.isCleanBranch());
- assertTrue(parent.isClean());
- assertTrue(parent.isCleanBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isCleanBranch());
- }
-
- public void testProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
-
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- Problem problem1 = node.problems().next();
-
- // now create another problem that should remove the old problem
- node.setName("STILL BOGUS");
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- Problem problem2 = node.problems().next();
- assertFalse(problem1 == problem2);
- problem1 = problem2;
-
- // now create another problem that should replace the old problem
- node.setName("STILL BOGUS");
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- problem2 = node.problems().next();
- // the same problem should be there
- assertTrue(problem1.equals(problem2));
- }
-
- public void testBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, node.branchProblemsSize());
-
- node.setName("okie-dokie");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(2, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(1, parent.branchProblemsSize());
- assertEquals(0, node.problemsSize());
- assertEquals(0, node.branchProblemsSize());
- }
-
- public void testClearAllBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, node.branchProblemsSize());
-
- parent.clearAllBranchProblems();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(1, this.root.branchProblemsSize());
- assertEquals(0, parent.problemsSize());
- assertEquals(0, parent.branchProblemsSize());
- assertEquals(0, node.problemsSize());
- assertEquals(0, CollectionTools.size(node.branchProblems()));
- }
-
- public void testRemovedBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, CollectionTools.size(this.root.branchProblems()));
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, CollectionTools.size(node.branchProblems()));
-
- // completely remove a node that has problems -
- // the entire tree should recalculate its "branch" problems
- parent.removeTestChild(node);
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(2, CollectionTools.size(this.root.branchProblems()));
- assertEquals(1, parent.problemsSize());
- assertEquals(1, parent.branchProblemsSize());
- }
-
- public void testSort() {
- List<TestWorkbenchModel> nodes = this.buildSortedNodes();
- assertTrue(new Range(0, 1).includes(this.indexOf(nodes, "aaa")));
- assertTrue(new Range(0, 1).includes(this.indexOf(nodes, "AAA")));
- assertTrue(new Range(2, 3).includes(this.indexOf(nodes, "bbb")));
- assertTrue(new Range(2, 3).includes(this.indexOf(nodes, "BBB")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "ccc")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "CCC")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "���")));
- }
-
- private int indexOf(List<TestWorkbenchModel> nodes, String nodeName) {
- for (int i = nodes.size(); i-- > 0; ) {
- if (nodes.get(i).getName().equals(nodeName)) {
- return i;
- }
- }
- throw new IllegalArgumentException();
- }
-
- private List<TestWorkbenchModel> buildSortedNodes() {
- List<TestWorkbenchModel> result = new ArrayList<TestWorkbenchModel>();
- result.add(new RootTestWorkbenchModel("AAA"));
- result.add(new RootTestWorkbenchModel("BBB"));
- result.add(new RootTestWorkbenchModel("CCC"));
- result.add(new RootTestWorkbenchModel("���"));
- result.add(new RootTestWorkbenchModel("ccc"));
- result.add(new RootTestWorkbenchModel("bbb"));
- result.add(new RootTestWorkbenchModel("aaa"));
- return CollectionTools.sort(result);
- }
-
-
- // ********** inner classes **********
-
- private class TestWorkbenchModel extends AbstractNode {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private int size;
- public static final String SIZE_PROPERTY = "size";
- private Collection<TestWorkbenchModel> testChildren;
- public static final String TEST_CHILDREN_COLLECTION = "children";
-
- // ********** construction/initialization **********
- public TestWorkbenchModel(TestWorkbenchModel parent, String name) {
- super(parent);
- if (name == null) {
- throw new NullPointerException();
- }
- this.name = name;
- }
- @Override
- protected void initialize() {
- super.initialize();
- this.size = 0;
- this.testChildren = new HashBag<TestWorkbenchModel>();
- }
-
- @Override
- protected void checkParent(Node parent) {
- // do nothing
- }
-
-
- // ********** accessors **********
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public int getSize() {
- return this.size;
- }
- public void setSize(int size) {
- int old = this.size;
- this.size = size;
- this.firePropertyChanged(SIZE_PROPERTY, old, size);
- }
-
- public Iterator<TestWorkbenchModel> testChildren() {
- return new CloneIterator<TestWorkbenchModel>(this.testChildren) {
- @Override
- protected void remove(TestWorkbenchModel current) {
- TestWorkbenchModel.this.removeTestChild(current);
- }
- };
- }
- public int testChildrenSize() {
- return this.testChildren.size();
- }
- private TestWorkbenchModel addTestChild(TestWorkbenchModel testChild) {
- this.addItemToCollection(testChild, this.testChildren, TEST_CHILDREN_COLLECTION);
- return testChild;
- }
- public TestWorkbenchModel addTestChildNamed(String childName) {
- if (this.testChildNamed(childName) != null) {
- throw new IllegalArgumentException(childName);
- }
- return this.addTestChild(new TestWorkbenchModel(this, childName));
- }
- public void removeTestChild(TestWorkbenchModel testChild) {
- this.removeItemFromCollection(testChild, this.testChildren, TEST_CHILDREN_COLLECTION);
- }
-
- // ********** queries **********
- public String displayString() {
- return this.name;
- }
- public TestWorkbenchModel testChildNamed(String childName) {
- for (TestWorkbenchModel testChild : this.testChildren) {
- if (testChild.getName().equals(childName)) {
- return testChild;
- }
- }
- return null;
- }
- public TestWorkbenchModel testDescendantNamed(String descendantName) {
- for (TestWorkbenchModel testDescendant : this.testChildren) {
- if (testDescendant.getName().equals(descendantName)) {
- return testDescendant;
- }
- // recurse...
- testDescendant = testDescendant.testDescendantNamed(descendantName);
- if (testDescendant != null) {
- return testDescendant;
- }
- }
- return null;
- }
-
- // ********** behavior **********
- @Override
- protected void addChildrenTo(List<Node> children) {
- super.addChildrenTo(children);
- children.addAll(this.testChildren);
- }
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- // names must be all lowercase...
- for (int i = this.name.length(); i-- > 0; ) {
- char c = this.name.charAt(i);
- if (Character.isLetter(c) && ! Character.isLowerCase(c)) {
- currentProblems.add(this.buildProblem("NAME_MUST_BE_LOWERCASE", this.name));
- return;
- }
- }
- }
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
- }
-
-
- private class RootTestWorkbenchModel extends TestWorkbenchModel {
- public RootTestWorkbenchModel(String name) {
- super(null, name);
- }
- @Override
- public Validator getValidator() {
- return Node.NULL_VALIDATOR;
- }
- }
-
-}
-
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java
deleted file mode 100644
index 94f682d878..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.node;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityNodeTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityNodeTests.class.getPackage().getName());
-
- suite.addTestSuite(AbstractNodeTests.class);
-
- return suite;
- }
-
- private JptUtilityNodeTests() {
- super();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml b/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
deleted file mode 100644
index bf3ab7e506..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.utility.tests"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.utility.tests.internal.JptUtilityTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value=""/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
-</project> \ No newline at end of file

Back to the top