Author: vyemialyanchyk
Date: 2009-03-09 09:56:04 -0400 (Mon, 09 Mar 2009)
New Revision: 14110
Added:
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Entity.java
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Identifiable.java
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Entity.java
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Identifiable.java
Modified:
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
Log:
JBIDE-3967 - add test case and commit into the brunch
Modified:
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-03-09
13:36:15 UTC (rev 14109)
+++
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -87,6 +87,7 @@
protected AllEntitiesProcessor processor = new AllEntitiesProcessor();
protected JPAMapToolActor() {
+ processor.initAnnotationStylePreference();
}
public static JPAMapToolActor getInstance() {
Modified:
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2009-03-09
13:36:15 UTC (rev 14109)
+++
branches/jbosstools-3.0.x/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -62,6 +62,9 @@
protected ArrayList<ChangeStructure> changes = new
ArrayList<ChangeStructure>();
public AllEntitiesProcessor() {
+ }
+
+ public void initAnnotationStylePreference() {
IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
int value = preferenceStore.getInt(AllEntitiesProcessor.class.toString());
if (value >= AnnotStyle.values().length) {
Added:
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Entity.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Entity.java
(rev 0)
+++
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Entity.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated.getters;
+
+// just specific test case
+public interface Entity extends Identifiable <Long>
+{ Long getId (); }
Added:
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Identifiable.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Identifiable.java
(rev 0)
+++
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Identifiable.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated.getters;
+
+public interface Identifiable <Type>
+{ Type getId (); }
\ No newline at end of file
Added:
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Entity.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Entity.java
(rev 0)
+++
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Entity.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated.getters;
+
+// just specific test case
+public interface Entity extends Identifiable <Long>
+{ Long getId (); }
Added:
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Identifiable.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Identifiable.java
(rev 0)
+++
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Identifiable.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated.getters;
+
+public interface Identifiable <Type>
+{ Type getId (); }
\ No newline at end of file
Modified:
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
===================================================================
---
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2009-03-09
13:36:15 UTC (rev 14109)
+++
branches/jbosstools-3.0.x/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2009-03-09
13:56:04 UTC (rev 14110)
@@ -125,6 +125,11 @@
// "test.annotated." + testSelection + ".Foto"); //$NON-NLS-1$
//$NON-NLS-2$
//ICompilationUnit icu2 = Utils.findCompilationUnit(javaProject,
// "test.annotated." + testSelection + ".Person"); //$NON-NLS-1$
//$NON-NLS-2$
+ ICompilationUnit icu4 = null;
+ if (testSelection == TEST_GETTERS) {
+ icu4 = Utils.findCompilationUnit(javaProject,
+ "test.annotated." + testSelection + ".FotoXPerson");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
assertNotNull(icu);
assertNotNull(icu2);
assertNotNull(icu3);
@@ -132,6 +137,9 @@
collector.collect(icu);
collector.collect(icu2);
collector.collect(icu3);
+ if (icu4 != null) {
+ collector.collect(icu4);
+ }
collector.resolveRelations();
processor.modify(javaProject, collector.getMapCUs_Info(), false);
//
@@ -142,6 +150,9 @@
checkItem("Staff"); //$NON-NLS-1$
checkItem("FotoXPerson"); //$NON-NLS-1$
checkItem("PersonXFoto"); //$NON-NLS-1$
+ if (icu4 != null) {
+ checkItem("Entity"); //$NON-NLS-1$
+ }
}
protected void checkItem(String strCheckItem) {