JBoss Tools SVN: r15639 - in trunk/hibernatetools/tests: org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-06-02 07:57:42 -0400 (Tue, 02 Jun 2009)
New Revision: 15639
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/SimpleTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ProjectUtil.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/TestUtilsCommon.java
Removed:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/CloseAllEditorsTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4366 - tests code review
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2009-06-02 11:57:42 UTC (rev 15639)
@@ -21,7 +21,8 @@
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
Export-Package: org.hibernate.eclipse.console.test,
- org.hibernate.eclipse.console.test.mappingproject,
+ org.hibernate.eclipse.console.test.project,
+ org.hibernate.eclipse.console.test.utils,
org.hibernate.eclipse.console.test.xpl,
org.hibernate.eclipse.hqleditor.preferences,
org.jmock,
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -36,6 +36,7 @@
protected void tearDown() throws Exception {
KnownConfigurations.getInstance().removeAllConfigurations();
+ consoleCfg = null;
}
static class TestConsoleConfigurationPreferences implements ConsoleConfigurationPreferences {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ExporterTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -33,6 +33,13 @@
factory = new ExporterFactory(definition, definition.getId());
}
+
+ protected void tearDown() throws Exception {
+ map = null;
+ factory = null;
+ definition = null;
+ }
+
public void testExporters() {
Map<String, ExporterProperty> properties = definition.getExporterProperties();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,12 +1,8 @@
package org.hibernate.eclipse.console.test;
-import java.util.logging.Logger;
-
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.ui.IPackagesViewPart;
@@ -17,6 +13,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.hibernate.eclipse.console.HibernateConsolePerspectiveFactory;
+import org.hibernate.eclipse.console.test.project.SimpleTestProject;
public abstract class HibernateConsoleTest extends TestCase {
@@ -73,6 +70,7 @@
this.project.deleteIProject();
+ this.project = null;
super.tearDown();
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -25,6 +25,7 @@
protected void tearDown() throws Exception {
KnownConfigurations.getInstance().removeAllConfigurations();
+ consoleCfg = null;
}
public void testQueryParameter() {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/RefactoringTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -36,6 +36,7 @@
import org.eclipse.jdt.internal.launching.DefaultProjectClasspathEntry;
import org.eclipse.jdt.internal.launching.RuntimeClasspathEntry;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.hibernate.eclipse.console.test.project.SimpleTestProject;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
import org.hibernate.eclipse.launch.core.refactoring.HibernateRefactoringUtil;
@@ -188,6 +189,13 @@
@Override
protected void tearDown() throws Exception {
project.deleteIProject();
+ project = null;
+ testStrConfig = null;
+ testStrListConfig = null;
+ testNotChangedConfig = null;
+ runtimeClasspathEntries = null;
+ affectSegmentsCount = null;
+ oldPathStr = null;
}
private void updatePaths(Path oldPath, Path newPath) throws CoreException{
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,189 +0,0 @@
-package org.hibernate.eclipse.console.test;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-public class SimpleTestProject {
-
- IProject project;
- IJavaProject javaProject;
-
- final private String projectName;
-
- public static final String PACKAGE_NAME = "test"; //$NON-NLS-1$
- public static final String TYPE_NAME = "TestClass"; //$NON-NLS-1$
- public static final String FILE_NAME = "TestClass.java"; //$NON-NLS-1$
-
-
- public SimpleTestProject(String projectName) {
- this.projectName=projectName;
- initialize();
- }
-
- public SimpleTestProject() {
- projectName = "HibernateToolsTestProject"; //$NON-NLS-1$
- initialize();
- }
-
- void initialize(){
- try{
- buildSimpleTestProject();
- }catch(Exception e){
- throw new RuntimeException(e);
- }
- }
-
- public IProject getIProject(){
- return this.project;
- }
-
- public IJavaProject getIJavaProject(){
- return this.javaProject;
- }
-
- public String getFullyQualifiedTestClassName(){
- return PACKAGE_NAME + "." + TYPE_NAME; //$NON-NLS-1$
- }
-
- public IType getTestClassType() {
-
- IType type = null;
- try {
- type = getIJavaProject().findType(getFullyQualifiedTestClassName());
- } catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- return type;
- }
-
- public IField getTestClassField() {
- return getTestClassType().getField("testField"); //$NON-NLS-1$
- }
-
- public void deleteIProject() {
- try {
- project.delete(true, true, null);
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
-
- }
-
- public void deleteIProject(boolean deleteContent) {
- try {
- project.delete(deleteContent, true, null);
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
-
- }
-
- protected void buildSimpleTestProject() throws JavaModelException, CoreException, IOException {
- project = buildNewProject(projectName);
- javaProject = buildJavaProject(project);
-
- buildType(buildPackage(PACKAGE_NAME, project, javaProject), FILE_NAME);
-
- }
-
- private IProject buildNewProject(String projectName) {
-
- // get a project handle
- final IProject newProjectHandle = ResourcesPlugin.getWorkspace()
- .getRoot().getProject(projectName);
-
- // get a project descriptor
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- final IProjectDescription description = workspace
- .newProjectDescription(newProjectHandle.getName());
-
- try {
- createAndOpenProject(description, newProjectHandle);
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
-
- return newProjectHandle;
- }
-
- private void createAndOpenProject(IProjectDescription description,
- IProject projectHandle) throws CoreException {
-
- projectHandle.create(description, null);
- projectHandle.open(IResource.BACKGROUND_REFRESH, null);
- }
-
- private IJavaProject buildJavaProject(IProject project) {
-
- IJavaProject javaProject = JavaCore.create(project);
- try {
- setJavaNature(project);
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
-
- javaProject.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
- javaProject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
- javaProject.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
- return javaProject;
- }
-
- private void setJavaNature(IProject project) throws CoreException {
- IProjectDescription description = project.getDescription();
- description.setNatureIds(new String[] { JavaCore.NATURE_ID });
- project.setDescription(description, null);
- }
-
-
- private IPackageFragmentRoot buildSourceFolder(IProject project,
- IJavaProject javaProject) throws CoreException {
- IFolder folder = project.getFolder("src"); //$NON-NLS-1$
- folder.create(false, true, null);
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
- IClasspathEntry[] newEntries = { JavaCore
- .newSourceEntry(root.getPath()) };
- javaProject.setRawClasspath(newEntries, null);
- return root;
- }
-
- private IPackageFragment buildPackage(String name, IProject project,
- IJavaProject javaProject) throws CoreException {
- IPackageFragmentRoot sourceFolder = buildSourceFolder(project,
- javaProject);
- return sourceFolder.createPackageFragment(name, false, null);
- }
-
- protected IType buildType(IPackageFragment pack, String cuName)
- throws JavaModelException {
-
- //create empty ICompilationUnit
-
- ICompilationUnit cu = pack.createCompilationUnit(cuName,
- "", false, null); //$NON-NLS-1$
-
- cu.createPackageDeclaration(pack.getElementName(),null);
- IType type = cu.createType("public class " + TYPE_NAME + " {}",null,false,null); //$NON-NLS-1$//$NON-NLS-2$
- type.createField("private String testField;",null,false,null); //$NON-NLS-1$
- type.createMethod("public String getTestField() {return this.testField;}",null,false,null); //$NON-NLS-1$
- type.createMethod("public void setTestField(String testField) {this.testField = testField;}",null,false,null); //$NON-NLS-1$
- return type;
- }
-
-}
-
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/CloseAllEditorsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/CloseAllEditorsTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/CloseAllEditorsTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import junit.framework.TestCase;
-
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class CloseAllEditorsTest extends TestCase {
-
- public void testCloseAllEditors(){
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
- }
-
-}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/Customization.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -44,11 +44,6 @@
public static final int EACTH_PACK_TEST_DELAY = 0;
/**
- * Delay in milliseconds before closing workspace
- */
- public static final long AFTER_ALL_PACKS_DELAY = 1000;
-
- /**
* Use time profiler
*/
public static final boolean USE_CONSOLE_OUTPUT = true;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -11,26 +11,27 @@
package org.hibernate.eclipse.console.test.mappingproject;
import java.io.File;
-import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.core.PackageFragmentRoot;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
import org.hibernate.tool.hbm2x.ArtifactCollector;
import org.hibernate.tool.hbm2x.ExporterException;
import org.hibernate.tool.hbm2x.HibernateMappingExporter;
@@ -46,8 +47,9 @@
IPackageFragment pack = HibernateAllMappingTests.getActivePackage();
try{
KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
- final ConsoleConfiguration consCFG = knownConfigurations.find(ProjectUtil.ConsoleCFGName);
+ final ConsoleConfiguration consCFG = knownConfigurations.find(ConsoleConfigUtils.ConsoleCFGName);
assertNotNull(consCFG);
+ //pack.getJavaProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
consCFG.reset();
consCFG.build();
assertTrue(consCFG.hasConfiguration());
@@ -69,7 +71,7 @@
for (int i = 0; i < ress.length; i++) {
if (ress[i] instanceof IFile){
IFile res = (IFile)ress[i];
- if (res.getName().endsWith(".hbm.xml")){ //$NON-NLS-1$
+ if (res.getName().endsWith(".hbm.xml")) { //$NON-NLS-1$
res.delete(true, false, null);
}
}
@@ -89,9 +91,9 @@
collector.formatFiles();
try {//build generated configuration
- pack.getResource().refreshLocal(IResource.DEPTH_ONE, null);
- waitForJobs();
- ProjectUtil.customizeCFGFileForPack(pack);
+ pack.getResource().refreshLocal(IResource.DEPTH_INFINITE, null);
+ pack.getJavaProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ ConsoleConfigUtils.customizeCfgXmlForPack(pack);
assertNotNull(consCFG);
consCFG.reset();
@@ -109,7 +111,7 @@
config = consCFG.getConfiguration();
} catch (CoreException e) {
String out = NLS.bind(ConsoleTestMessages.UpdateConfigurationTest_error_customising_file_for_package,
- new Object[] { ProjectUtil.CFG_FILE_NAME, pack.getPath(), e.getMessage() } );
+ new Object[] { ConsoleConfigUtils.CFG_FILE_NAME, pack.getPath(), e.getMessage() } );
fail(out);
}
} catch (ExporterException e){
@@ -122,56 +124,17 @@
}
private File getSrcFolder() throws JavaModelException{
- MappingTestProject mapProject = MappingTestProject.getTestProject();
+ ConfigurableTestProject mapProject = ConfigurableTestProject.getTestProject();
PackageFragmentRoot packageFragmentRoot = null;
IPackageFragmentRoot[] roots = mapProject.getIJavaProject().getAllPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getClass() != PackageFragmentRoot.class) continue;
- packageFragmentRoot = (PackageFragmentRoot) roots[i];
- break;
+ for (int i = 0; i < roots.length && packageFragmentRoot == null; i++) {
+ if (roots[i].getClass() == PackageFragmentRoot.class) {
+ packageFragmentRoot = (PackageFragmentRoot) roots[i];
+ }
}
assertNotNull(packageFragmentRoot);
return packageFragmentRoot.getResource().getLocation().toFile();
}
-
- public void waitForJobs() {
- long start = System.currentTimeMillis();
- // Job.getJobManager().isIdle() is more efficient than EditorTestHelper.allJobsQuiet()
- // EditorTestHelper.allJobsQuiet() isn't thread-safe
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=198241 is fixed
- //while (!EditorTestHelper.allJobsQuiet()) {
- while (!Job.getJobManager().isIdle()) {
- delay(1000);
- if ( (System.currentTimeMillis()-start) > MAX_IDLE )
- throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
- }
- }
- private static final long MAX_IDLE = 30*60*1000L;
-
- protected void delay(long waitTimeMillis) {
- if (waitTimeMillis <= 0) return;
- Display display = Display.getCurrent();
-
- // If this is the UI thread,
- // then process input.
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.update();
- }
-
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
}
class WripperException extends Exception {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -17,8 +17,9 @@
import junit.framework.TestResult;
import junit.framework.TestSuite;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
@@ -26,15 +27,19 @@
import org.eclipse.jdt.internal.core.PackageFragmentRoot;
import org.eclipse.jdt.ui.IPackagesViewPart;
import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.hibernate.eclipse.console.HibernateConsolePerspectiveFactory;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
+import org.hibernate.eclipse.console.test.utils.FilesTransfer;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
public class HibernateAllMappingTests extends TestCase {
- private MappingTestProject project;
+ private ConfigurableTestProject project;
private static IPackageFragment activePackage;
@@ -46,13 +51,11 @@
protected void setUp() throws Exception {
super.setUp();
- this.project = MappingTestProject.getTestProject();
+ this.project = ConfigurableTestProject.getTestProject();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective")); //$NON-NLS-1$
- waitForJobs();
-
IPackagesViewPart packageExplorer = null;
try {
packageExplorer = (IPackagesViewPart) PlatformUI.getWorkbench()
@@ -67,20 +70,13 @@
.getActiveWorkbenchWindow().getActivePage().setPerspective(
PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(HibernateConsolePerspectiveFactory.ID_CONSOLE_PERSPECTIVE));
-
- waitForJobs();
- runTestsAfterSetup();
- ProjectUtil.createConsoleCFG();
+ IPath cfgFilePath = new Path(ConfigurableTestProject.PROJECT_NAME + "/" + //$NON-NLS-1$
+ FilesTransfer.SRC_FOLDER + "/" + ConsoleConfigUtils.CFG_FILE_NAME); //$NON-NLS-1$
+ ConsoleConfigUtils.createConsoleConfig(ConsoleConfigUtils.ConsoleCFGName,
+ cfgFilePath, ConfigurableTestProject.PROJECT_NAME);
+ ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, ConsoleConfigUtils.ConsoleCFGName);
}
- private void runTestsAfterSetup() {
- TestSuite suite = TestSetAfterSetup.getTests();
- for (int i = 0; i < suite.testCount(); i++) {
- Test test = suite.testAt(i);
- test.run(result);
- }
- }
-
/* (non-Javadoc)
* @see junit.framework.TestCase#run(junit.framework.TestResult)
*/
@@ -91,71 +87,14 @@
}
public void tearDown() throws Exception {
- waitForJobs();
- runTestsBeforeTearDown();
- waitForJobs();
- delay(1000);
- //this.project.deleteIProject();
- //waitForJobs();
+ ProjectUtils.toggleHibernateOnProject(project.getIProject(), false, ConsoleConfigUtils.ConsoleCFGName);
+ ConsoleConfigUtils.deleteConsoleConfig(ConsoleConfigUtils.ConsoleCFGName);
+ project.deleteIProject(false);
+ project = null;
super.tearDown();
}
- private void runTestsBeforeTearDown() {
- TestSuite suite = TestSetBeforeTearDown.getTests();
- for (int i = 0; i < suite.testCount(); i++) {
- Test test = suite.testAt(i);
- test.run(result);
- }
- }
-
- /**
- * Process UI input but do not return for the specified time interval.
- *
- * @param waitTimeMillis
- * the number of milliseconds
- */
- protected void delay(long waitTimeMillis) {
- if (waitTimeMillis <= 0) return;
- Display display = Display.getCurrent();
-
- // If this is the UI thread,
- // then process input.
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.update();
- }
-
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
- private static final long MAX_IDLE = 30*60*1000L;
- /**
- * Wait until all background tasks are complete.
- */
- public void waitForJobs() {
- long start = System.currentTimeMillis();
- // Job.getJobManager().isIdle() is more efficient than EditorTestHelper.allJobsQuiet()
- // EditorTestHelper.allJobsQuiet() isn't thread-safe
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=198241 is fixed
- //while (!EditorTestHelper.allJobsQuiet()) {
- while (!Job.getJobManager().isIdle()) {
- delay(1000);
- if ( (System.currentTimeMillis()-start) > MAX_IDLE )
- throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
- }
- }
-
- protected MappingTestProject getProject() {
+ protected ConfigurableTestProject getProject() {
return this.project;
}
@@ -165,53 +104,62 @@
int pack_count = 0;
IPackageFragmentRoot[] roots = project.getIJavaProject().getAllPackageFragmentRoots();
for (int i = 0; i < roots.length; i++) {
- if (roots[i].getClass() != PackageFragmentRoot.class) continue;
+ if (roots[i].getClass() != PackageFragmentRoot.class) {
+ continue;
+ }
PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) roots[i];
IJavaElement[] els = packageFragmentRoot.getChildren();
for (int j = 0; j < els.length; j++) {
IJavaElement javaElement = els[j];
- if (javaElement instanceof IPackageFragment){
- IPackageFragment pack = (IPackageFragment) javaElement;
- // use packages only with compilation units
- if (pack.getCompilationUnits().length == 0) continue;
- if (Customization.U_TEST_PACKS_PATTERN &&
- !Pattern.matches(Customization.TEST_PACKS_PATTERN, javaElement.getElementName())){
+ if (!(javaElement instanceof IPackageFragment)) {
+ continue;
+ }
+ IPackageFragment pack = (IPackageFragment)javaElement;
+ // use packages only with compilation units
+ if (pack.getCompilationUnits().length == 0) {
+ continue;
+ }
+ if (Customization.U_TEST_PACKS_PATTERN) {
+ if (!Pattern.matches(Customization.TEST_PACKS_PATTERN, javaElement.getElementName())) {
continue;
}
+ }
- long st_pack_time = System.currentTimeMillis();
- int prev_failCount = result.failureCount();
- int prev_errCount = result.errorCount();
+ long st_pack_time = System.currentTimeMillis();
+ int prev_failCount = result.failureCount();
+ int prev_errCount = result.errorCount();
- if (Customization.SHOW_EACH_TEST) suite = TestSet.getTests();
+ if (Customization.SHOW_EACH_TEST) {
+ // this display result for each test in JUinit view
+ suite = TestSet.getTests();
+ }
- activePackage = pack;
- //==============================
- //run all tests for package
- for (int k = 0; k < suite.testCount(); k++) {
- Test test = suite.testAt(k);
- test.run(result);
- waitForJobs();
- }
- //==============================
- pack_count++;
- if (Customization.USE_CONSOLE_OUTPUT){
- System.out.print( result.errorCount() - prev_errCount + ConsoleTestMessages.HibernateAllMappingTests_errors + " \t"); //$NON-NLS-1$
- System.out.print( result.failureCount() - prev_failCount + ConsoleTestMessages.HibernateAllMappingTests_fails + "\t"); //$NON-NLS-1$
- long period = System.currentTimeMillis() - st_pack_time;
- String time = period / 1000 + "." + (period % 1000) / 100; //$NON-NLS-1$
- System.out.println( time +ConsoleTestMessages.HibernateAllMappingTests_seconds +
- " {" + javaElement.getElementName() + "}"); //$NON-NLS-1$//$NON-NLS-2$
- }
- waitForJobs();
- delay(Customization.EACTH_PACK_TEST_DELAY);
+ activePackage = pack;
+ customizeCfgXml(pack);
+ //==============================
+ //run all tests for package
+ //suite.run(result);
+ for (int k = 0; k < suite.testCount(); k++) {
+ Test test = suite.testAt(k);
+ test.run(result);
+ }
+ closeAllEditors();
+ //==============================
+ pack_count++;
+ if (Customization.USE_CONSOLE_OUTPUT){
+ System.out.print( result.errorCount() - prev_errCount + ConsoleTestMessages.HibernateAllMappingTests_errors + " \t"); //$NON-NLS-1$
+ System.out.print( result.failureCount() - prev_failCount + ConsoleTestMessages.HibernateAllMappingTests_fails + "\t"); //$NON-NLS-1$
+ long period = System.currentTimeMillis() - st_pack_time;
+ String time = period / 1000 + "." + (period % 1000) / 100; //$NON-NLS-1$
+ System.out.println( time +ConsoleTestMessages.HibernateAllMappingTests_seconds +
+ " {" + javaElement.getElementName() + "}"); //$NON-NLS-1$//$NON-NLS-2$
+ }
- if (Customization.STOP_AFTER_MISSING_PACK){
- if (result.failureCount() > prev_failCount) break;
- }
- prev_failCount = result.failureCount();
- prev_errCount = result.errorCount();
+ if (Customization.STOP_AFTER_MISSING_PACK){
+ if (result.failureCount() > prev_failCount) break;
}
+ prev_failCount = result.failureCount();
+ prev_errCount = result.errorCount();
}
}
if (Customization.USE_CONSOLE_OUTPUT){
@@ -221,15 +169,27 @@
System.out.print(( System.currentTimeMillis() - start_time ) / 1000 + ConsoleTestMessages.HibernateAllMappingTests_seconds + "\t" ); //$NON-NLS-1$
System.out.println( pack_count + ConsoleTestMessages.HibernateAllMappingTests_packages_tested );
}
- waitForJobs();
-
- delay(Customization.AFTER_ALL_PACKS_DELAY);
}
+ protected void customizeCfgXml(IPackageFragment pack) {
+ assertNotNull(pack);
+ try {
+ ConsoleConfigUtils.customizeCfgXmlForPack(pack);
+ } catch (CoreException e) {
+ String out = NLS.bind(ConsoleTestMessages.UpdateConfigurationTest_error_customising_file_for_package,
+ new Object[] { ConsoleConfigUtils.CFG_FILE_NAME, pack.getPath(), e.getMessage() } );
+ fail(out);
+ }
+ }
+
+ protected void closeAllEditors() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ }
+
/**
* @return the activePackage
*/
- public static IPackageFragment getActivePackage() {
+ public static synchronized IPackageFragment getActivePackage() {
return activePackage;
}
}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.hibernate.eclipse.console.utils.ProjectUtils;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class HibernateNatureAddTest extends TestCase {
- public void testHibernateNatureAdd() throws BackingStoreException, CoreException {
- MappingTestProject project = MappingTestProject.getTestProject();
- IJavaProject prj = project.getIJavaProject();
-
- ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, "testcfg"); //$NON-NLS-1$
- }
-}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.hibernate.eclipse.console.utils.ProjectUtils;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class HibernateNatureRemoveTest extends TestCase {
- public void testHibernateNatureRemove() throws BackingStoreException, CoreException {
- MappingTestProject project = MappingTestProject.getTestProject();
- ProjectUtils.toggleHibernateOnProject(project.getIProject(), true, "testcfg"); //$NON-NLS-1$
- }
-}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.osgi.util.NLS;
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
-
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class MappingTestProject{
-
- private static MappingTestProject singleton= null;
-
- public static final String PROJECT_NAME = "MappingTestProject"; //$NON-NLS-1$
- public static final String RESOURCE_PATH = "res/project/"; //$NON-NLS-1$
-
- private IProject project;
- private IJavaProject javaProject;
-
- public static MappingTestProject getTestProject(){
- if (singleton == null){
- singleton = new MappingTestProject();
- }
- return singleton;
- }
-
- private MappingTestProject() {
- initialize();
- }
-
- private void initialize(){
- try{
- buildBigTestProject();
- }catch(Exception e){
- throw new RuntimeException(e);
- }
- }
-
- public IProject getIProject(){
- return this.project;
- }
-
- public IJavaProject getIJavaProject(){
- return this.javaProject;
- }
-
- public void deleteIProject() throws CoreException {
- project.delete(true, true, null);
- }
-
- private void buildBigTestProject() throws JavaModelException, CoreException, IOException {
- TestUtilsCommon commonUtil = new TestUtilsCommon();
- project = commonUtil.buildNewProject(PROJECT_NAME);
- javaProject = commonUtil.buildJavaProject(project);
-
- IPath resourcePath = new Path(RESOURCE_PATH);
- File resourceFolder = resourcePath.toFile();
- URL entry = HibernateConsoleTestPlugin.getDefault().getBundle().getEntry(RESOURCE_PATH);
- URL resProject = FileLocator.resolve(entry);
- String tplPrjLcStr= FileLocator.resolve(resProject).getFile();
- resourceFolder = new File(tplPrjLcStr);
- if (!resourceFolder.exists()) {
- String out = NLS.bind(ConsoleTestMessages.MappingTestProject_folder_not_found,
- RESOURCE_PATH);
- throw new RuntimeException(out);
- }
-
- IPackageFragmentRoot sourceFolder = commonUtil.createSourceFolder(project, javaProject);
- commonUtil.recursiveCopyFiles(resourceFolder, (IFolder) sourceFolder.getResource());
- List<IPath> libs = commonUtil.copyLibs(project, javaProject, resourceFolder);
- commonUtil.generateClassPath(javaProject, libs, sourceFolder);
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
- }
-
-
-
- /*private boolean removePackage(String name, IProject project,
- IJavaProject javaProject) {
- IFolder folder = project.getFolder("src");
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
- IPackageFragment useless = root.getPackageFragment(name);
- if (useless != null){
- try {
- useless.delete(true, new NullProgressMonitor());
- } catch (JavaModelException e) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /*private IPackageFragment buildPackage(String name, IProject project,
- IJavaProject javaProject) throws CoreException {
- IPackageFragmentRoot sourceFolder = buildSourceFolder(project,
- javaProject);
- return sourceFolder.createPackageFragment(name, false, null);
- }
-
- private IType[] buildTypes(IProject project, IJavaProject javaProject, CompilationPack compPack) throws CoreException
- /*throws CoreException*/ //{
-
- //create empty ICompilationUnit
- //String cuName = compPack.getPack().getName();
- /*IPackageFragment jPack = buildPackage(compPack.getPack(), project, javaProject);
- ICompilationUnit cu = null;//jPack.createCompilationUnit(cuName,
- //"", false, null);
-
- List<IType> result = new ArrayList<IType>();
-
- InputStream is;
- try {
- File[] files = compPack.getFiles();
- for (int i = 0; i < files.length; i++) {
- if (files[i].getName().endsWith(".java")){
- is = new FileInputStream(files[i]);
- String fileBody = getStringFromStream(is);
-
- //ASTParser parser = ASTParser.newParser(AST.JLS3);
- //parser.setSource(fileBody.toCharArray());
- //CompilationUnit cu2 = (CompilationUnit) parser.createAST(null);
- String cuName = files[i].getName();
-
- try {
- cu = jPack.createCompilationUnit(cuName, fileBody, false, null);
- result.addAll(Arrays.asList(cu.getAllTypes()));
- } catch (JavaModelException e) {
- e.printStackTrace();
- System.out.println("Error compiling file " + files[i].getAbsolutePath());
- }
- }
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- for (int i = 0; i < result.size(); i++) {
- System.out.println(((IType)result.get(i)).getElementName());
- }
- return (IType[])result.toArray(new IType[0]);
- }
-
- public static String getStringFromStream (InputStream is)
- throws IOException
- {
- try {
- InputStreamReader reader = new InputStreamReader(is);
- char[] buffer = new char[1024];
- StringWriter writer = new StringWriter();
- int bytes_read;
- while ((bytes_read = reader.read(buffer)) != -1)
- {resourceFolder.exists()
- writer.write(buffer, 0, bytes_read);
- }
- return (writer.toString());
- }
- finally {
- if (null != is) is.close();
- }
- }
-
- private void createCompilationPacks(File pack, List<CompilationPack> compPacks, String packName){
- if (pack.isDirectory()){
- if (packName.length() != 0) packName += '.';
- packName += pack.getName();
-
- File[] files = pack.listFiles(fileFilter);
- if (files.length > 0) compPacks.add(new CompilationPack(packName, files));
-
- File[] dirs = pack.listFiles(dirFilter);
- for (int i = 0; i < dirs.length; i++) {
- createCompilationPacks(dirs[i], compPacks, packName);
- }
- }
- }
-
- public class CompilationPack {
-
- private String pack = null;
-
- private File[] files = null;
-
- CompilationPack (String pack, File[] files){
- this.pack = pack;
- this.files = files;
- }
-
- public String getPack() {
- return pack;
- }
-
- public File[] getFiles() {
- return files;
- }
- }*/
-
-}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenJavaEditors.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.PackageFragmentRoot;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-
-/**
- * @author Dmitry Geraskov
- * @deprecated - never used
- * just to test that our external Unit tests work right with MappingTestProject
- */
-public class OpenJavaEditors extends TestCase {
-
- public void testOpenJavaEditor() throws JavaModelException {
- MappingTestProject mapProject = MappingTestProject.getTestProject();
-
- IPackageFragmentRoot[] roots = mapProject.getIJavaProject().getAllPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getClass() != PackageFragmentRoot.class) continue;
- PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) roots[i];
- IJavaElement[] els = packageFragmentRoot.getChildren();//.getCompilationUnits();
- for (int j = 0; j < els.length; j++) {
- IJavaElement javaElement = els[j];
- if (javaElement instanceof IPackageFragment){
- ICompilationUnit[] cus = ((IPackageFragment)javaElement).getCompilationUnits();
- for (int k = 0; k < cus.length; k++) {
- ICompilationUnit compilationUnit = cus[k];
- FileEditorInput input = new FileEditorInput((IFile) compilationUnit.getCorrespondingResource());
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, JavaUI.ID_CU_EDITOR );
- } catch (PartInitException e) {
- fail(ConsoleTestMessages.OpenJavaEditors_error_openning_compilationunit + e.getMessage());
- }
- }
- }
- }
- }
-
- //PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
- }
-}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -16,11 +16,12 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.hibernate.InvalidMappingException;
-import org.hibernate.MappingException;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
+import org.hibernate.eclipse.console.test.utils.ProjectUtil;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
import org.hibernate.mapping.PersistentClass;
@@ -33,7 +34,7 @@
public class OpenMappingDiagramTest extends TestCase {
public void testOpenMappingDiagram() {
KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
- final ConsoleConfiguration consCFG = knownConfigurations.find(ProjectUtil.ConsoleCFGName);
+ final ConsoleConfiguration consCFG = knownConfigurations.find(ConsoleConfigUtils.ConsoleCFGName);
assertNotNull(consCFG);
consCFG.reset();
Object[] configs = null;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -11,25 +11,21 @@
package org.hibernate.eclipse.console.test.mappingproject;
import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
import junit.framework.TestCase;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.InvalidMappingException;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
+import org.hibernate.eclipse.console.test.utils.ProjectUtil;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
@@ -45,7 +41,7 @@
public void testOpenMappingFileTest() {
KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
- final ConsoleConfiguration consCFG = knownConfigurations.find(ProjectUtil.ConsoleCFGName);
+ final ConsoleConfiguration consCFG = knownConfigurations.find(ConsoleConfigUtils.ConsoleCFGName);
assertNotNull(consCFG);
consCFG.reset();
Object[] configs = null;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -24,6 +24,8 @@
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.actions.OpenSourceAction;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
+import org.hibernate.eclipse.console.test.utils.ProjectUtil;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
@@ -41,7 +43,7 @@
public void testOpenSourceFileTest() {
//fail("test fail");
KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
- final ConsoleConfiguration consCFG = knownConfigurations.find(ProjectUtil.ConsoleCFGName);
+ final ConsoleConfiguration consCFG = knownConfigurations.find(ConsoleConfigUtils.ConsoleCFGName);
assertNotNull(consCFG);
consCFG.reset();
Object[] configs = null;
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.filters.StringInputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.ErrorEditorPart;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-import org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard;
-import org.hibernate.eclipse.console.wizards.ConsoleConfigurationWizardPage;
-import org.hibernate.eclipse.launch.ConsoleConfigurationMainTab;
-import org.hibernate.mapping.PersistentClass;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-@SuppressWarnings("restriction")
-public class ProjectUtil {
-
- private static final StringBuilder XML_HEADER = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") //$NON-NLS-1$
- .append("<!DOCTYPE hibernate-configuration PUBLIC\n") //$NON-NLS-1$
- .append("\"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n") //$NON-NLS-1$
- .append("\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n"); //$NON-NLS-1$
-
- private static final StringBuilder XML_CFG_START = new StringBuilder("<hibernate-configuration>\n") //$NON-NLS-1$
- .append("<session-factory>\n") //$NON-NLS-1$
- .append("<property name=\"hibernate.dialect\">") //$NON-NLS-1$
- .append(Customization.HIBERNATE_DIALECT)
- .append("</property>"); //$NON-NLS-1$
-
- private static final StringBuilder XML_CFG_END = new StringBuilder("</session-factory>\n") //$NON-NLS-1$
- .append("</hibernate-configuration>\n"); //$NON-NLS-1$
-
-
- public static final String CFG_FILE_NAME = "hibernate.cfg.xml"; //$NON-NLS-1$
-
- public static final String ConsoleCFGName = "testConfigName"; //$NON-NLS-1$
-
- public static void customizeCFGFileForPack(IPackageFragment pack) throws CoreException{
- IFolder srcFolder = (IFolder) pack.getParent().getResource();
- IFile iFile = srcFolder.getFile(CFG_FILE_NAME);
- if (iFile.exists()) {
- iFile.delete(true, null);
- }
- String file_body = XML_HEADER.toString() + XML_CFG_START.toString();
- if (pack.getNonJavaResources().length > 0){
- Object[] ress = pack.getNonJavaResources();
- for (int i = 0; i < ress.length; i++) {
- if (ress[i] instanceof IFile){
- IFile res = (IFile)ress[i];
- if (res.getName().endsWith(".hbm.xml")){ //$NON-NLS-1$
- file_body += "<mapping resource=\"" + pack.getElementName().replace('.', '/') + '/' + res.getName() + "\"/>\n"; //$NON-NLS-1$//$NON-NLS-2$
- }
- }
- }
- }
- /*if (pack.getCompilationUnits().length > 0){
- ICompilationUnit[] comps = pack.getCompilationUnits();
- for (int i = 0; i < comps.length; i++) {
- ICompilationUnit compilationUnit = comps[i];
- IType[] types = compilationUnit.getTypes();
- for (int j = 0; j < types.length; j++) {
- IType type = types[j];
- if (type.isAnnotation()){
- System.out.println(type);
- }
- }
- }
- }*/
-
- file_body += XML_CFG_END.toString();
- iFile.create(new StringInputStream(file_body),
- true, null);
- }
-
- public static String getPersistentClassName(PersistentClass persClass) {
- if (persClass == null) {
- return ""; //$NON-NLS-1$
- } else {
- return persClass.getEntityName() != null ? persClass.getEntityName() : persClass.getClassName();
- }
- }
-
- public static void createConsoleCFG() throws CoreException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException{
- ConsoleConfigurationCreationWizard2 wiz = new ConsoleConfigurationCreationWizard2();
- IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- WizardDialog wdialog = new WizardDialog(win.getShell(), wiz);
- wdialog.create();
- wiz.run();
- wdialog.close();
- }
-
- private static class ConsoleConfigurationCreationWizard2 extends ConsoleConfigurationCreationWizard{
-
- public void run() throws CoreException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
- IPath cfgFilePath = new Path(MappingTestProject.PROJECT_NAME + "/" + //$NON-NLS-1$
- TestUtilsCommon.SRC_FOLDER + "/" + ProjectUtil.CFG_FILE_NAME); //$NON-NLS-1$
- ConsoleConfigurationWizardPage page = ((ConsoleConfigurationWizardPage)getPages()[0]);
- ILaunchConfigurationTab[] tabs = page.getTabs();
- ConsoleConfigurationMainTab main = (ConsoleConfigurationMainTab) tabs[0];
- Class<? extends ConsoleConfigurationMainTab> clazz = main.getClass();
- Field projectName = clazz.getDeclaredField("projectNameText"); //$NON-NLS-1$
- projectName.setAccessible(true);
- Text text = (Text) projectName.get(main);
- text.setText(MappingTestProject.PROJECT_NAME);
- page.setConfigurationFilePath(cfgFilePath);
- page.setName(ConsoleCFGName);
- page.performFinish();
- }
- }
-
- /**
- * Sometimes we have exceptions while opening editors.
- * IDE catches this exceptions and opens ErrorEditorPart instead of
- * our editor. To be sure that editor opened without exception use this method.
- * It gets occurred exception from the editor if it was and passes it up.
- *
- * @param editor
- * @return
- * @throws Throwable
- */
- public static Throwable getExceptionIfItOccured(IEditorPart editor){
- if (editor instanceof ErrorEditorPart){
- Class<ErrorEditorPart> clazz = ErrorEditorPart.class;
- Field field;
- try {
- field = clazz.getDeclaredField("error"); //$NON-NLS-1$
-
- field.setAccessible(true);
-
- Object error = field.get(editor);
- if (error instanceof IStatus) {
- IStatus err_status = (IStatus) error;
- if (err_status.getSeverity() == Status.ERROR){
- return err_status.getException();
- }
- }
- // catch close means that exception occurred but we can't get it
- } catch (SecurityException e) {
- return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_exception_from_erroreditorpart + e.getMessage());
- } catch (NoSuchFieldException e) {
- return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_error_field_from_erroreditorpart + e.getMessage());
- } catch (IllegalArgumentException e) {
- return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_error_field_from_erroreditorpart + e.getMessage());
- } catch (IllegalAccessException e) {
- return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_error_field_from_erroreditorpart + e.getMessage());
- }
- }
- return null;
- }
-
- public static boolean checkHighlighting(IEditorPart editor){
- ITextEditor[] tEditors = getTextEditors(editor);
- boolean highlighted = false;
- for (int i = 0; i < tEditors.length && !highlighted; i++) {
- ITextEditor textEditor = tEditors[i];
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof TextSelection){
- TextSelection tSelection = (TextSelection)selection;
- highlighted = tSelection.getLength() > 0;
- }
- }
- return highlighted;
- }
-
-
- /**
- * Should be identical with OpenMappingAction.getTextEditors()
- * @param editorPart
- * @return
- */
- public static ITextEditor[] getTextEditors(IEditorPart editorPart) {
- if (editorPart instanceof MultiPageEditorPart) {
- List<IEditorPart> testEditors = new ArrayList<IEditorPart>();
- IEditorPart[] editors = ((MultiPageEditorPart) editorPart).findEditors(editorPart.getEditorInput());
- for (int i = 0; i < editors.length; i++) {
- if (editors[i] instanceof ITextEditor){
- testEditors.add(editors[i]);
- }
- }
- return testEditors.toArray(new ITextEditor[0]);
- } else if (editorPart instanceof ITextEditor){
- return new ITextEditor[]{(ITextEditor) editorPart};
- }
- return new ITextEditor[0];
- }
-}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -24,30 +24,16 @@
* use only addTestSuit to prevent errors!!!
* @return
*/
- public static TestSuite getTests(){
+ public static TestSuite getTests() {
TestSuite suite = new TestSuite(ConsoleTestMessages.TestSet_test_for_mappingtestproject);
-
- addTestsPackSetUp( suite );
- addPackTests( suite );
- addTestsPackTearDown( suite );
-
+ addPackTests(suite);
return suite;
}
-
- private static void addTestsPackSetUp(TestSuite suite){
- suite.addTestSuite( UpdateConfigurationTest.class );
+ private static void addPackTests(TestSuite suite) {
+ /*suite.addTestSuite(OpenSourceFileTest.class);
+ suite.addTestSuite(OpenMappingFileTest.class);
+ suite.addTestSuite(OpenMappingDiagramTest.class);*/
+ suite.addTestSuite(HbmExportExceptionTest.class);
}
-
- private static void addPackTests(TestSuite suite){
- /*suite.addTestSuite( OpenSourceFileTest.class );
- suite.addTestSuite( OpenMappingFileTest.class );
- suite.addTestSuite( OpenMappingDiagramTest.class );*/
- suite.addTestSuite( HbmExportExceptionTest.class );
- }
-
- private static void addTestsPackTearDown(TestSuite suite){
- suite.addTestSuite( CloseAllEditorsTest.class );
- }
-
}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-
-import junit.framework.TestSuite;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class TestSetAfterSetup {
- public static TestSuite getTests(){
- TestSuite suite = new TestSuite(ConsoleTestMessages.TestSet_test_for_mappingtestproject);
- suite.addTestSuite( HibernateNatureAddTest.class );
- //suite.addTestSuite( CreateConsoleConfigTest.class );
- return suite;
- }
-}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-
-import junit.framework.TestSuite;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class TestSetBeforeTearDown {
- public static TestSuite getTests(){
- TestSuite suite = new TestSuite(ConsoleTestMessages.TestSet_test_for_mappingtestproject );
- suite.addTestSuite( HibernateNatureRemoveTest.class );
-
- return suite;
- }
-}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.internal.resources.ResourceException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.osgi.util.NLS;
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-
-/**
- *
- *
- * @author Vitali
- */
-public class TestUtilsCommon {
-
- public static final String SRC_FOLDER = "src"; //$NON-NLS-1$
- public static final String LIB_FOLDER = "lib"; //$NON-NLS-1$
-
- public static final Path JRE_CONTAINER = new Path(
- "org.eclipse.jdt.launching.JRE_CONTAINER"); //$NON-NLS-1$
-
- protected FileFilter fileFilter = new FileFilter() {
- public boolean accept(File pathname) {
- return !pathname.isDirectory();
- }
- };
-
- protected FileFilter dirFilter = new FileFilter() {
- public boolean accept(File pathname) {
- // exclude ".svn" and other unnessesary folders
- if (pathname.getName().charAt(0) == '.')
- return false;
- if (LIB_FOLDER.equals(pathname.getName()))
- return false;
- return pathname.isDirectory();
- }
- };
-
- protected FileFilter jarFilter = new FileFilter() {
- public boolean accept(File pathname) {
- return !pathname.isDirectory()
- || pathname.getName().endsWith(".jar"); //$NON-NLS-1$
- }
- };
-
- public FileFilter getFileFilter() {
- return fileFilter;
- }
-
- public void setFileFilter(FileFilter fileFilter) {
- this.fileFilter = fileFilter;
- }
-
- public FileFilter getDirFilter() {
- return dirFilter;
- }
-
- public void setDirFilter(FileFilter dirFilter) {
- this.dirFilter = dirFilter;
- }
-
- public FileFilter getJarFilter() {
- return jarFilter;
- }
-
- public void setJarFilter(FileFilter jarFilter) {
- this.jarFilter = jarFilter;
- }
-
- public void recursiveCopyFiles(File src, IFolder dst) {
- File[] files = src.listFiles(fileFilter);
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (!file.exists()) {
- continue;
- }
- IFile iFile = dst.getFile(file.getName());
- try {
- if (iFile.exists()) {
- iFile.delete(true, null);
- }
- iFile.create(new FileInputStream(file), true, null);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- continue;
- } catch (CoreException e) {
- e.printStackTrace();
- continue;
- }
- }
-
- File[] dirs = src.listFiles(dirFilter);
- for (int i = 0; i < dirs.length; i++) {
- File dir = dirs[i];
- if (!dir.exists()) {
- continue;
- }
- IFolder iFolder = dst.getFolder(dir.getName());
- try {
- if (!iFolder.exists()) {
- iFolder.create(true, true, null);
- }
- recursiveCopyFiles(dir, iFolder);
- } catch (CoreException e) {
- e.printStackTrace();
- continue;
- }
- }
- }
-
- public IProject buildNewProject(String projectName) {
- // get a project handle
- final IProject newProjectHandle = ResourcesPlugin.getWorkspace()
- .getRoot().getProject(projectName);
-
- // get a project descriptor
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- final IProjectDescription description = workspace
- .newProjectDescription(newProjectHandle.getName());
-
- try {
- createAndOpenProject(description, newProjectHandle);
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
-
- return newProjectHandle;
- }
-
- public void createAndOpenProject(IProjectDescription description,
- IProject projectHandle) throws CoreException {
-
- try {
- projectHandle.create(description, null);
- } catch (ResourceException re) {
- // if the project exist - ignore exception
- if (re.getStatus().getCode() != 374 || re.getStatus().getSeverity() != IStatus.ERROR ||
- !"org.eclipse.core.resources".equals(re.getStatus().getPlugin())) { //$NON-NLS-1$
- throw re;
- }
- }
- projectHandle.open(IResource.BACKGROUND_REFRESH, null);
- }
-
- public IJavaProject buildJavaProject(IProject project) {
- IJavaProject javaProject = JavaCore.create(project);
- try {
- setJavaNature(project);
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
-
- javaProject.setOption(JavaCore.COMPILER_COMPLIANCE,
- JavaCore.VERSION_1_5);
- javaProject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM,
- JavaCore.VERSION_1_5);
- javaProject.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
- return javaProject;
- }
-
- public void setJavaNature(IProject project) throws CoreException {
- IProjectDescription description = project.getDescription();
- description.setNatureIds(new String[] { JavaCore.NATURE_ID });
- project.setDescription(description, null);
- }
-
- public IPackageFragmentRoot createFolder(IProject project,
- IJavaProject javaProject, String strFolder) throws CoreException {
- IFolder folder = project.getFolder(strFolder);
- if (!folder.exists()) {
- folder.create(false, true, null);
- IPackageFragmentRoot root = javaProject
- .getPackageFragmentRoot(folder);
- /*
- * IClasspathEntry[] newEntries = { JavaCore
- * .newSourceEntry(root.getPath()) , JavaCore
- * .newContainerEntry(JRE_CONTAINER)};
- * javaProject.setRawClasspath(newEntries, null);
- */
- return root;
- }
- return javaProject.getPackageFragmentRoot(folder);
- }
-
- public IPackageFragmentRoot createSourceFolder(IProject project,
- IJavaProject javaProject) throws CoreException {
- return createFolder(project, javaProject, SRC_FOLDER);
- }
-
- public List<IPath> copyLibs(IProject project, IJavaProject javaProject,
- File res) throws CoreException {
- return copyLibs2(project, javaProject,
- res.getAbsolutePath() + File.separator + TestUtilsCommon.LIB_FOLDER);
- }
-
- public List<IPath> copyLibs2(IProject project, IJavaProject javaProject,
- String absolutePath) throws CoreException {
- IFolder dst = project.getFolder(TestUtilsCommon.LIB_FOLDER);
- if (!dst.exists()) {
- dst.create(false, true, null);
- javaProject.getPackageFragmentRoot(dst);
- }
- File libFolder = new File(absolutePath);
- if (!libFolder.exists()) {
- String out = NLS.bind(
- ConsoleTestMessages.MappingTestProject_folder_not_found,
- absolutePath);
- throw new RuntimeException(out);
- }
- List<IPath> libs = new ArrayList<IPath>();
-
- File[] files = libFolder.listFiles(jarFilter);
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (!file.exists()) {
- continue;
- }
- IFile iFile = dst.getFile(file.getName());
- if (iFile.exists()) {
- iFile.delete(true, null);
- }
- try {
- iFile.create(new FileInputStream(file), true, null);
- libs.add(iFile.getFullPath());
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- continue;
- }
- }
- return libs;
- }
-
- public void generateClassPath(IJavaProject javaProject, List<IPath> libs,
- IPackageFragmentRoot sourceFolder) throws JavaModelException {
- List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
- // entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
- for (IPath lib_path : libs) {
- entries.add(JavaCore.newLibraryEntry(lib_path, null, null));
- }
- entries.add(JavaCore.newSourceEntry(sourceFolder.getPath()));
- entries.add(JavaCore.newContainerEntry(JRE_CONTAINER));
- javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[0]),
- null);
- }
-}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.mappingproject;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.osgi.util.NLS;
-import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class UpdateConfigurationTest extends TestCase {
-
- public void testUpdateConfiguration() throws JavaModelException{
- //fail("test fail");
- IPackageFragment pack = HibernateAllMappingTests.getActivePackage();
- assertNotNull( pack );
- try {
- ProjectUtil.customizeCFGFileForPack(pack);
- } catch (CoreException e) {
- String out = NLS.bind(ConsoleTestMessages.UpdateConfigurationTest_error_customising_file_for_package,
- new Object[] { ProjectUtil.CFG_FILE_NAME, pack.getPath(), e.getMessage() } );
- fail(out);
- }
- }
-}
Copied: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java (from rev 15019, trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestProject.java)
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.project;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
+import org.hibernate.eclipse.console.test.mappingproject.Customization;
+import org.hibernate.eclipse.console.test.utils.FilesTransfer;
+import org.hibernate.eclipse.console.test.utils.TestUtilsCommon;
+
+
+/**
+ *
+ *
+ * @author Dmitry Geraskov
+ */
+public class ConfigurableTestProject {
+
+ private static ConfigurableTestProject singleton = null;
+
+ public static final String PROJECT_NAME = "ConfigurableTestProject"; //$NON-NLS-1$
+ public static final String RESOURCE_PATH = "res/project/"; //$NON-NLS-1$
+
+ private IProject project;
+ private IJavaProject javaProject;
+
+ public static ConfigurableTestProject getTestProject(){
+ if (singleton == null){
+ singleton = new ConfigurableTestProject();
+ }
+ return singleton;
+ }
+
+ private ConfigurableTestProject() {
+ initialize();
+ }
+
+ private void initialize(){
+ try{
+ buildBigTestProject();
+ }catch(Exception e){
+ throw new RuntimeException(e);
+ }
+ }
+
+ public IProject getIProject(){
+ return this.project;
+ }
+
+ public IJavaProject getIJavaProject(){
+ return this.javaProject;
+ }
+
+ public void deleteIProject(boolean deleteContent) {
+ try {
+ project.delete(deleteContent, true, null);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+ }
+
+ private void buildBigTestProject() throws JavaModelException, CoreException, IOException {
+ TestUtilsCommon commonUtil = new TestUtilsCommon();
+ project = commonUtil.buildNewProject(PROJECT_NAME);
+ javaProject = commonUtil.buildJavaProject(project);
+
+ IPath resourcePath = new Path(RESOURCE_PATH);
+ File resourceFolder = resourcePath.toFile();
+ URL entry = HibernateConsoleTestPlugin.getDefault().getBundle().getEntry(RESOURCE_PATH);
+ URL resProject = FileLocator.resolve(entry);
+ String tplPrjLcStr= FileLocator.resolve(resProject).getFile();
+ resourceFolder = new File(tplPrjLcStr);
+ if (!resourceFolder.exists()) {
+ String out = NLS.bind(ConsoleTestMessages.MappingTestProject_folder_not_found,
+ RESOURCE_PATH);
+ throw new RuntimeException(out);
+ }
+
+ long startCopyFiles = System.currentTimeMillis();
+ IPackageFragmentRoot sourceFolder = commonUtil.createSourceFolder(project, javaProject);
+ FilesTransfer.copyFolder(resourceFolder, (IFolder) sourceFolder.getResource());
+ long startCopyLibs = System.currentTimeMillis();
+ List<IPath> libs = commonUtil.copyLibs(project, javaProject, resourceFolder);
+ long startBuild = System.currentTimeMillis();
+ commonUtil.generateClassPath(javaProject, libs, sourceFolder);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ long stopBuild = System.currentTimeMillis();
+ if (Customization.USE_CONSOLE_OUTPUT){
+ System.out.println("====================================================="); //$NON-NLS-1$
+ System.out.println("copyFiles: " + ( ( startCopyLibs - startCopyFiles ) / 1000 )); //$NON-NLS-1$
+ System.out.println("copyLibs: " + ( ( startBuild - startCopyLibs ) / 1000 )); //$NON-NLS-1$
+ System.out.println("build: " + ( ( stopBuild - startBuild ) / 1000 )); //$NON-NLS-1$
+ }
+ }
+
+}
Copied: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/SimpleTestProject.java (from rev 15019, trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java)
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/SimpleTestProject.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/SimpleTestProject.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -0,0 +1,189 @@
+package org.hibernate.eclipse.console.test.project;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+
+public class SimpleTestProject {
+
+ IProject project;
+ IJavaProject javaProject;
+
+ final private String projectName;
+
+ public static final String PACKAGE_NAME = "test"; //$NON-NLS-1$
+ public static final String TYPE_NAME = "TestClass"; //$NON-NLS-1$
+ public static final String FILE_NAME = "TestClass.java"; //$NON-NLS-1$
+
+
+ public SimpleTestProject(String projectName) {
+ this.projectName=projectName;
+ initialize();
+ }
+
+ public SimpleTestProject() {
+ projectName = "HibernateToolsTestProject"; //$NON-NLS-1$
+ initialize();
+ }
+
+ void initialize(){
+ try{
+ buildSimpleTestProject();
+ }catch(Exception e){
+ throw new RuntimeException(e);
+ }
+ }
+
+ public IProject getIProject(){
+ return this.project;
+ }
+
+ public IJavaProject getIJavaProject(){
+ return this.javaProject;
+ }
+
+ public String getFullyQualifiedTestClassName(){
+ return PACKAGE_NAME + "." + TYPE_NAME; //$NON-NLS-1$
+ }
+
+ public IType getTestClassType() {
+
+ IType type = null;
+ try {
+ type = getIJavaProject().findType(getFullyQualifiedTestClassName());
+ } catch (JavaModelException e) {
+ throw new RuntimeException(e);
+ }
+ return type;
+ }
+
+ public IField getTestClassField() {
+ return getTestClassType().getField("testField"); //$NON-NLS-1$
+ }
+
+ public void deleteIProject() {
+ try {
+ project.delete(true, true, null);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ }
+
+ public void deleteIProject(boolean deleteContent) {
+ try {
+ project.delete(deleteContent, true, null);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ }
+
+ protected void buildSimpleTestProject() throws JavaModelException, CoreException, IOException {
+ project = buildNewProject(projectName);
+ javaProject = buildJavaProject(project);
+
+ buildType(buildPackage(PACKAGE_NAME, project, javaProject), FILE_NAME);
+
+ }
+
+ private IProject buildNewProject(String projectName) {
+
+ // get a project handle
+ final IProject newProjectHandle = ResourcesPlugin.getWorkspace()
+ .getRoot().getProject(projectName);
+
+ // get a project descriptor
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProjectDescription description = workspace
+ .newProjectDescription(newProjectHandle.getName());
+
+ try {
+ createAndOpenProject(description, newProjectHandle);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ return newProjectHandle;
+ }
+
+ private void createAndOpenProject(IProjectDescription description,
+ IProject projectHandle) throws CoreException {
+
+ projectHandle.create(description, null);
+ projectHandle.open(IResource.BACKGROUND_REFRESH, null);
+ }
+
+ private IJavaProject buildJavaProject(IProject project) {
+
+ IJavaProject javaProject = JavaCore.create(project);
+ try {
+ setJavaNature(project);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ javaProject.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
+ javaProject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
+ javaProject.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
+ return javaProject;
+ }
+
+ private void setJavaNature(IProject project) throws CoreException {
+ IProjectDescription description = project.getDescription();
+ description.setNatureIds(new String[] { JavaCore.NATURE_ID });
+ project.setDescription(description, null);
+ }
+
+
+ private IPackageFragmentRoot buildSourceFolder(IProject project,
+ IJavaProject javaProject) throws CoreException {
+ IFolder folder = project.getFolder("src"); //$NON-NLS-1$
+ folder.create(false, true, null);
+ IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
+ IClasspathEntry[] newEntries = { JavaCore
+ .newSourceEntry(root.getPath()) };
+ javaProject.setRawClasspath(newEntries, null);
+ return root;
+ }
+
+ private IPackageFragment buildPackage(String name, IProject project,
+ IJavaProject javaProject) throws CoreException {
+ IPackageFragmentRoot sourceFolder = buildSourceFolder(project,
+ javaProject);
+ return sourceFolder.createPackageFragment(name, false, null);
+ }
+
+ protected IType buildType(IPackageFragment pack, String cuName)
+ throws JavaModelException {
+
+ //create empty ICompilationUnit
+
+ ICompilationUnit cu = pack.createCompilationUnit(cuName,
+ "", false, null); //$NON-NLS-1$
+
+ cu.createPackageDeclaration(pack.getElementName(),null);
+ IType type = cu.createType("public class " + TYPE_NAME + " {}",null,false,null); //$NON-NLS-1$//$NON-NLS-2$
+ type.createField("private String testField;",null,false,null); //$NON-NLS-1$
+ type.createMethod("public String getTestField() {return this.testField;}",null,false,null); //$NON-NLS-1$
+ type.createMethod("public void setTestField(String testField) {this.testField = testField;}",null,false,null); //$NON-NLS-1$
+ return type;
+ }
+
+}
+
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -0,0 +1,134 @@
+package org.hibernate.eclipse.console.test.utils;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import org.apache.tools.ant.filters.StringInputStream;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.test.mappingproject.Customization;
+import org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard;
+import org.hibernate.eclipse.console.wizards.ConsoleConfigurationWizardPage;
+import org.hibernate.eclipse.launch.ConsoleConfigurationMainTab;
+
+/**
+ * Test utility class to operate with Hibernate Console configuration
+ *
+ * @author vitali
+ */
+public class ConsoleConfigUtils {
+
+ private ConsoleConfigUtils() {}
+
+ private static final String XML_HEADER = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") //$NON-NLS-1$
+ .append("<!DOCTYPE hibernate-configuration PUBLIC\n") //$NON-NLS-1$
+ .append("\"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n") //$NON-NLS-1$
+ .append("\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n").toString(); //$NON-NLS-1$
+
+ private static final String XML_CFG_START = new StringBuilder("<hibernate-configuration>\n") //$NON-NLS-1$
+ .append("<session-factory>\n") //$NON-NLS-1$
+ .append("<property name=\"hibernate.dialect\">") //$NON-NLS-1$
+ .append(Customization.HIBERNATE_DIALECT)
+ .append("</property>").toString(); //$NON-NLS-1$
+
+ private static final String XML_CFG_END = new StringBuilder("</session-factory>\n") //$NON-NLS-1$
+ .append("</hibernate-configuration>\n").toString(); //$NON-NLS-1$
+
+ public static final String CFG_FILE_NAME = "hibernate.cfg.xml"; //$NON-NLS-1$
+
+ public static final String ConsoleCFGName = "testConfigName"; //$NON-NLS-1$
+
+ /**
+ * Create hibernate.cfg.xml file content for the particular test package content.
+ * @param pack
+ * @return a string, which is hibernate.cfg.xml content
+ * @throws CoreException
+ */
+ public static String createCfgXmlContent(IPackageFragment pack) throws CoreException {
+ StringBuilder str = new StringBuilder();
+ str.append(XML_HEADER);
+ str.append(XML_CFG_START);
+ if (pack.getNonJavaResources().length > 0){
+ Object[] ress = pack.getNonJavaResources();
+ for (int i = 0; i < ress.length; i++) {
+ if (!(ress[i] instanceof IFile)) {
+ continue;
+ }
+ IFile file = (IFile)ress[i];
+ if (file.getName().endsWith(".hbm.xml")){ //$NON-NLS-1$
+ str.append("<mapping resource=\"");//$NON-NLS-1$
+ str.append(pack.getElementName().replace('.', '/'));
+ str.append('/');
+ str.append(file.getName());
+ str.append("\"/>\n"); //$NON-NLS-1$
+ }
+ }
+ }
+ str.append(XML_CFG_END);
+ return str.toString();
+ }
+
+ /**
+ * Customize hibernate.cfg.xml file for the particular test package content.
+ * @param pack
+ * @throws CoreException
+ */
+ public static void customizeCfgXmlForPack(IPackageFragment pack) throws CoreException {
+ StringInputStream sis = new StringInputStream(createCfgXmlContent(pack));
+ IFolder srcFolder = (IFolder) pack.getParent().getResource();
+ IFile iFile = srcFolder.getFile(CFG_FILE_NAME);
+ if (iFile.exists()) {
+ iFile.delete(true, null);
+ }
+ iFile.create(sis, true, null);
+ try {
+ sis.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * "Launch" the wizard and create hibernate console configuration in the current workspace.
+ * @param name - console configuration name
+ * @param cfgFilePath - path to hibernate.cfg.xml
+ * @param project - name of java project selected for console configuration
+ * @throws CoreException
+ * @throws NoSuchFieldException
+ * @throws IllegalAccessException
+ */
+ public static void createConsoleConfig(String name, IPath cfgFilePath, String project) throws CoreException, NoSuchFieldException, IllegalAccessException {
+ final IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ final ConsoleConfigurationCreationWizard wiz = new ConsoleConfigurationCreationWizard();
+ final WizardDialog wdialog = new WizardDialog(win.getShell(), wiz);
+ wdialog.create();
+ ConsoleConfigurationWizardPage page = ((ConsoleConfigurationWizardPage)wiz.getPages()[0]);
+ ILaunchConfigurationTab[] tabs = page.getTabs();
+ ConsoleConfigurationMainTab main = (ConsoleConfigurationMainTab) tabs[0];
+ Class<? extends ConsoleConfigurationMainTab> clazz = main.getClass();
+ Field projectName = clazz.getDeclaredField("projectNameText"); //$NON-NLS-1$
+ projectName.setAccessible(true);
+ Text text = (Text) projectName.get(main);
+ text.setText(project);
+ page.setConfigurationFilePath(cfgFilePath);
+ page.setName(name);
+ page.performFinish();
+ wdialog.close();
+ }
+
+ public static void deleteConsoleConfig(String name) {
+ final KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
+ final ConsoleConfiguration consoleConfig = knownConfigurations.find(name);
+ knownConfigurations.removeConfiguration(consoleConfig, false);
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/FilesTransfer.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -0,0 +1,127 @@
+package org.hibernate.eclipse.console.test.utils;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Test utility class to operate with files and folders
+ *
+ * @author vitali
+ */
+public class FilesTransfer {
+
+ private FilesTransfer() {}
+
+ public static final String SRC_FOLDER = "src"; //$NON-NLS-1$
+ public static final String LIB_FOLDER = "lib"; //$NON-NLS-1$
+
+ public static final FileFilter filterFiles = new FileFilter() {
+ public boolean accept(File pathname) {
+ return !pathname.isDirectory();
+ }
+ };
+
+ public static final FileFilter filterFolders = new FileFilter() {
+ public boolean accept(File pathname) {
+ // exclude ".svn" and other unnecessary folders
+ if (pathname.getName().charAt(0) == '.') {
+ return false;
+ }
+ if (LIB_FOLDER.equals(pathname.getName())) {
+ return false;
+ }
+ return pathname.isDirectory();
+ }
+ };
+
+ public static final FileFilter filterJars = new FileFilter() {
+ public boolean accept(File pathname) {
+ return !pathname.isDirectory()
+ || pathname.getName().endsWith(".jar"); //$NON-NLS-1$
+ }
+ };
+
+ /**
+ * Copy whole folder content from source folder to destination folder.
+ * @param src - source folder
+ * @param dst - destination folder.
+ */
+ public static void copyFolder(File src, IFolder dst) {
+ copyFolder(src, dst, filterFiles, filterFolders, null);
+ }
+
+ /**
+ * Copy whole folder content from source folder to destination folder.
+ * @param src - source folder
+ * @param dst - destination folder.
+ * @param filterFiles - to filter particular files
+ * @param filterFolders - to filter particular folders
+ * @param filesList - to collect all paths to files which was copied
+ */
+ public static void copyFolder(File src, IFolder dst,
+ FileFilter filterFiles, FileFilter filterFolders, List<IPath> filesList) {
+ File[] files = src.listFiles(filterFiles);
+ for (int i = 0; i < files.length; i++) {
+ File file = files[i];
+ if (!file.exists()) {
+ continue;
+ }
+ IFile iFile = dst.getFile(file.getName());
+ FileInputStream fis = null;
+ BufferedInputStream bis = null;
+ try {
+ if (iFile.exists()) {
+ iFile.delete(true, null);
+ }
+ fis = new FileInputStream(file);
+ bis = new BufferedInputStream(fis);
+ iFile.create(bis, IResource.FORCE, null);
+ if (filesList != null) {
+ filesList.add(iFile.getFullPath());
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } finally {
+ if (bis != null) {
+ try {
+ bis.close();
+ } catch (IOException e) {}
+ }
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {}
+ }
+ }
+ }
+ File[] dirs = src.listFiles(filterFolders);
+ for (int i = 0; i < dirs.length; i++) {
+ File dir = dirs[i];
+ if (!dir.exists()) {
+ continue;
+ }
+ IFolder iFolder = dst.getFolder(dir.getName());
+ try {
+ if (!iFolder.exists()) {
+ iFolder.create(true, true, null);
+ }
+ copyFolder(dir, iFolder, filterFiles, filterFolders, filesList);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
Copied: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ProjectUtil.java (from rev 15400, trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java)
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ProjectUtil.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ProjectUtil.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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 org.hibernate.eclipse.console.test.utils;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.internal.ErrorEditorPart;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.utils.OpenMappingUtils;
+import org.hibernate.mapping.PersistentClass;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+@SuppressWarnings("restriction")
+public class ProjectUtil {
+
+
+ public static String getPersistentClassName(PersistentClass persClass) {
+ if (persClass == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return persClass.getEntityName() != null ? persClass.getEntityName() : persClass.getClassName();
+ }
+
+ /**
+ * Sometimes we have exceptions while opening editors.
+ * IDE catches this exceptions and opens ErrorEditorPart instead of
+ * our editor. To be sure that editor opened without exception use this method.
+ * It gets occurred exception from the editor if it was and passes it up.
+ *
+ * @param editor
+ * @return
+ * @throws Throwable
+ */
+ public static Throwable getExceptionIfItOccured(IEditorPart editor){
+ if (editor instanceof ErrorEditorPart){
+ Class<ErrorEditorPart> clazz = ErrorEditorPart.class;
+ Field field;
+ try {
+ field = clazz.getDeclaredField("error"); //$NON-NLS-1$
+
+ field.setAccessible(true);
+
+ Object error = field.get(editor);
+ if (error instanceof IStatus) {
+ IStatus err_status = (IStatus) error;
+ if (err_status.getSeverity() == Status.ERROR){
+ return err_status.getException();
+ }
+ }
+ // catch close means that exception occurred but we can't get it
+ } catch (SecurityException e) {
+ return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_exception_from_erroreditorpart + e.getMessage());
+ } catch (NoSuchFieldException e) {
+ return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_error_field_from_erroreditorpart + e.getMessage());
+ } catch (IllegalArgumentException e) {
+ return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_error_field_from_erroreditorpart + e.getMessage());
+ } catch (IllegalAccessException e) {
+ return new RuntimeException(ConsoleTestMessages.ProjectUtil_cannot_get_error_field_from_erroreditorpart + e.getMessage());
+ }
+ }
+ return null;
+ }
+
+ public static boolean checkHighlighting(IEditorPart editor){
+ ITextEditor[] tEditors = OpenMappingUtils.getTextEditors(editor);
+ boolean highlighted = false;
+ for (int i = 0; i < tEditors.length && !highlighted; i++) {
+ ITextEditor textEditor = tEditors[i];
+ ISelection selection = textEditor.getSelectionProvider().getSelection();
+ if (selection instanceof TextSelection){
+ TextSelection tSelection = (TextSelection)selection;
+ highlighted = tSelection.getLength() > 0;
+ }
+ }
+ return highlighted;
+ }
+}
Copied: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/TestUtilsCommon.java (from rev 15019, trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java)
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/TestUtilsCommon.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/TestUtilsCommon.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * 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 org.hibernate.eclipse.console.test.utils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.internal.resources.ResourceException;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+
+/**
+ *
+ */
+public class TestUtilsCommon {
+
+ public static final Path JRE_CONTAINER = new Path(
+ "org.eclipse.jdt.launching.JRE_CONTAINER"); //$NON-NLS-1$
+
+
+ public IProject buildNewProject(String projectName) {
+ // get a project handle
+ final IProject newProjectHandle = ResourcesPlugin.getWorkspace()
+ .getRoot().getProject(projectName);
+
+ // get a project descriptor
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProjectDescription description = workspace
+ .newProjectDescription(newProjectHandle.getName());
+
+ try {
+ createAndOpenProject(description, newProjectHandle);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ return newProjectHandle;
+ }
+
+ public void createAndOpenProject(IProjectDescription description,
+ IProject projectHandle) throws CoreException {
+
+ try {
+ projectHandle.create(description, null);
+ } catch (ResourceException re) {
+ // if the project exist - ignore exception
+ if (re.getStatus().getCode() != 374 || re.getStatus().getSeverity() != IStatus.ERROR ||
+ !"org.eclipse.core.resources".equals(re.getStatus().getPlugin())) { //$NON-NLS-1$
+ throw re;
+ }
+ }
+ projectHandle.open(IResource.BACKGROUND_REFRESH, null);
+ }
+
+ public IJavaProject buildJavaProject(IProject project) {
+ IJavaProject javaProject = JavaCore.create(project);
+ try {
+ setJavaNature(project);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ javaProject.setOption(JavaCore.COMPILER_COMPLIANCE,
+ JavaCore.VERSION_1_5);
+ javaProject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM,
+ JavaCore.VERSION_1_5);
+ javaProject.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
+ return javaProject;
+ }
+
+ public void setJavaNature(IProject project) throws CoreException {
+ IProjectDescription description = project.getDescription();
+ description.setNatureIds(new String[] { JavaCore.NATURE_ID });
+ project.setDescription(description, null);
+ }
+
+ public IPackageFragmentRoot createFolder(IProject project,
+ IJavaProject javaProject, String strFolder) throws CoreException {
+ IFolder folder = project.getFolder(strFolder);
+ if (!folder.exists()) {
+ folder.create(true, true, null);
+ IPackageFragmentRoot root = javaProject
+ .getPackageFragmentRoot(folder);
+ /*
+ * IClasspathEntry[] newEntries = { JavaCore
+ * .newSourceEntry(root.getPath()) , JavaCore
+ * .newContainerEntry(JRE_CONTAINER)};
+ * javaProject.setRawClasspath(newEntries, null);
+ */
+ return root;
+ }
+ return javaProject.getPackageFragmentRoot(folder);
+ }
+
+ public IPackageFragmentRoot createSourceFolder(IProject project,
+ IJavaProject javaProject) throws CoreException {
+ return createFolder(project, javaProject, FilesTransfer.SRC_FOLDER);
+ }
+
+ public List<IPath> copyLibs(IProject project, IJavaProject javaProject,
+ File res) throws CoreException {
+ return copyLibs2(project, javaProject,
+ res.getAbsolutePath() + File.separator + FilesTransfer.LIB_FOLDER);
+ }
+
+ public List<IPath> copyLibs2(IProject project, IJavaProject javaProject,
+ String absolutePath) throws CoreException {
+ IFolder dst = project.getFolder(FilesTransfer.LIB_FOLDER);
+ if (!dst.exists()) {
+ dst.create(true, true, null);
+ javaProject.getPackageFragmentRoot(dst);
+ }
+ File libFolder = new File(absolutePath);
+ if (!libFolder.exists()) {
+ String out = NLS.bind(
+ ConsoleTestMessages.MappingTestProject_folder_not_found,
+ absolutePath);
+ throw new RuntimeException(out);
+ }
+ List<IPath> libs = new ArrayList<IPath>();
+ FilesTransfer.copyFolder(libFolder, dst, FilesTransfer.filterJars,
+ FilesTransfer.filterFolders, libs);
+ return libs;
+ }
+
+ public void generateClassPath(IJavaProject javaProject, List<IPath> libs,
+ IPackageFragmentRoot sourceFolder) throws JavaModelException {
+ List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
+ // entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
+ for (IPath lib_path : libs) {
+ entries.add(JavaCore.newLibraryEntry(lib_path, null, null));
+ }
+ entries.add(JavaCore.newSourceEntry(sourceFolder.getPath()));
+ entries.add(JavaCore.newContainerEntry(JRE_CONTAINER));
+ javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[0]),
+ null);
+ }
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -12,7 +12,7 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.hibernate.eclipse.console.test.mappingproject.MappingTestProject;
+import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
import org.hibernate.eclipse.mapper.extractor.JavaTypeHandler;
import org.hibernate.eclipse.mapper.extractor.PackageHandler;
import junit.framework.TestCase;
@@ -26,7 +26,7 @@
public void executeJavaTypeHandlerTest(String start, String attributeName) {
sourceLocator.setPackageName("org"); //$NON-NLS-1$
- MappingTestProject testProj = MappingTestProject.getTestProject();
+ ConfigurableTestProject testProj = ConfigurableTestProject.getTestProject();
IJavaProject project = testProj.getIJavaProject();
JavaTypeHandler javaTypeHandler = new JavaTypeHandler(sourceLocator);
ICompletionProposal[] res =
@@ -54,7 +54,7 @@
public void executePackageHandlerTest(String start, String attributeName) {
sourceLocator.setPackageName("org"); //$NON-NLS-1$
- MappingTestProject testProj = MappingTestProject.getTestProject();
+ ConfigurableTestProject testProj = ConfigurableTestProject.getTestProject();
IJavaProject project = testProj.getIJavaProject();
PackageHandler packageHandler = new PackageHandler(sourceLocator);
ICompletionProposal[] res =
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -29,7 +29,7 @@
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.test.HibernateConsoleTest;
-import org.hibernate.eclipse.console.test.SimpleTestProject;
+import org.hibernate.eclipse.console.test.project.SimpleTestProject;
import org.hibernate.eclipse.console.test.xpl.JavaProjectHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.jdt.ui.internal.HQLDetector;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -19,7 +19,7 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.hibernate.eclipse.console.test.HibernateConsoleTest;
-import org.hibernate.eclipse.console.test.SimpleTestProject;
+import org.hibernate.eclipse.console.test.project.SimpleTestProject;
import org.hibernate.eclipse.console.test.xpl.JavaProjectHelper;
public class HibernateErrorsTest extends HibernateConsoleTest {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -27,7 +27,7 @@
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.test.HibernateConsoleTest;
-import org.hibernate.eclipse.console.test.SimpleTestProject;
+import org.hibernate.eclipse.console.test.project.SimpleTestProject;
import org.hibernate.eclipse.console.test.xpl.JavaProjectHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -32,7 +32,8 @@
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.osgi.util.NLS;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-import org.hibernate.eclipse.console.test.mappingproject.TestUtilsCommon;
+import org.hibernate.eclipse.console.test.utils.FilesTransfer;
+import org.hibernate.eclipse.console.test.utils.TestUtilsCommon;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
@@ -232,7 +233,7 @@
}
IPackageFragmentRoot sourceFolder = commonUtil.createSourceFolder(
project, javaProject);
- commonUtil.recursiveCopyFiles(resourceFolder, (IFolder) sourceFolder
+ FilesTransfer.copyFolder(resourceFolder, (IFolder) sourceFolder
.getResource());
File resourceFolderLib = getResourceItem(TESTRESOURCE_PATH);
if (!resourceFolderLib.exists()) {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java 2009-06-02 08:46:37 UTC (rev 15638)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java 2009-06-02 11:57:42 UTC (rev 15639)
@@ -23,7 +23,8 @@
import org.eclipse.osgi.util.NLS;
import org.hibernate.cfg.Configuration;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
-import org.hibernate.eclipse.console.test.mappingproject.TestUtilsCommon;
+import org.hibernate.eclipse.console.test.utils.FilesTransfer;
+import org.hibernate.eclipse.console.test.utils.TestUtilsCommon;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
@@ -219,7 +220,7 @@
}
IPackageFragmentRoot sourceFolder = commonUtil.createSourceFolder(
project, javaProject);
- commonUtil.recursiveCopyFiles(resourceFolder, (IFolder) sourceFolder
+ FilesTransfer.copyFolder(resourceFolder, (IFolder) sourceFolder
.getResource());
File resourceFolderLib = getResourceItem(TESTRESOURCE_PATH);
if (!resourceFolderLib.exists()) {
15 years, 7 months
JBoss Tools SVN: r15637 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui: internal/platform and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-06-02 04:43:06 -0400 (Tue, 02 Jun 2009)
New Revision: 15637
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4404
Removed xpl package as we don't want to support dali 2.0 any more.
Core refactored.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -15,10 +15,11 @@
import java.util.List;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaPageComposite;
import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.jpt.utility.internal.StringConverter;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
@@ -35,13 +36,12 @@
import org.hibernate.eclipse.launch.PathHelper;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.ui.wizard.Messages;
-import org.jboss.tools.hibernate.jpt.ui.xpl.AbstractPane;
/**
* @author Dmitry Geraskov
*
*/
-public class HibernatePropertiesComposite extends AbstractPane<BasicHibernateProperties> implements
+public class HibernatePropertiesComposite extends FormPane<BasicHibernateProperties> implements
JpaPageComposite {
private Text cfgFile;
@@ -60,7 +60,7 @@
protected void initializeLayout(Composite container) {
- Composite section = buildSection(container, Messages.HibernatePropertiesComposite_basic_properties);
+ Composite section = addSection(container, Messages.HibernatePropertiesComposite_basic_properties);
helper = new DriverClassHelpers();
@@ -89,30 +89,33 @@
final WritablePropertyValueModel<String> driverHolder = buildDriverHolder();
final WritablePropertyValueModel<String> urlHolder = buildUrlHolder();
- Button b = buildButton(section, HibernateConsoleMessages.CodeGenerationSettingsTab_browse, createSetupAction());
- cfgFile = buildLabeledText(section,
+ Button b = addButton(section, HibernateConsoleMessages.CodeGenerationSettingsTab_browse, createSetupAction());
+ cfgFile = addLabeledText(section,
HibernateConsoleMessages.ConsoleConfigurationPropertySource_config_file + ':', buildConfigFileHolder(),
b, null);
- buildLabeledEditableCombo(
+ addLabeledEditableCombo(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_database_dialect,
lvmDialect,
dialectHolder,
+ StringConverter.Default.<String>instance(),
null);
- buildLabeledEditableCombo(
+ addLabeledEditableCombo(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_driver_class,
lvmDriver,
- driverHolder,
+ driverHolder,
+ StringConverter.Default.<String>instance(),
null);
- buildLabeledEditableCombo(
- section,
- HibernateConsoleMessages.NewConfigurationWizardPage_connection_url,
+ addLabeledEditableCombo(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_connection_url,
lvmUrl,
- urlHolder,
+ urlHolder,
+ StringConverter.Default.<String>instance(),
null);
dialectHolder.addPropertyChangeListener(new SWTPropertyChangeListenerWrapper(
@@ -142,22 +145,22 @@
}
) );
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_default_schema,
buildSchemaDefaultHolder());
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_default_catalog,
buildCatalogDefaultHolder());
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_user_name,
buildUsernameHolder());
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_password,
buildPasswordHolder());
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -35,7 +35,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateJpaPlatformUi extends GenericJpaPlatformUi {
public static final String LaunchConfigurationType_ID = "org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"; //$NON-NLS-1$
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -21,7 +21,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateJpaPlatformUiFactory implements JpaPlatformUiFactory {
public HibernateJpaPlatformUiFactory() {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -18,6 +18,7 @@
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaPageComposite;
import org.eclipse.jpt.ui.internal.GenericJpaUiFactory;
+import org.eclipse.jpt.ui.internal.persistence.details.GenericPersistenceUnitGeneralComposite;
import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitConnectionComposite;
import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitPropertiesComposite;
import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
@@ -26,13 +27,11 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.HibernatePropertiesComposite;
-import org.jboss.tools.hibernate.jpt.ui.xpl.PersistenceUnitGeneralComposite;
/**
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateJpaUiFactory extends GenericJpaUiFactory {
@SuppressWarnings("unchecked")
@@ -41,9 +40,8 @@
List<JpaPageComposite> pages = new ArrayList<JpaPageComposite>(1);
- //replaced from Dali 2.0
- pages.add(new PersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory));
- pages.add(new PersistenceUnitConnectionComposite(subjectHolder, parent, widgetFactory));
+ pages.add(new GenericPersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory));
+ pages.add(new PersistenceUnitConnectionComposite(subjectHolder, parent, widgetFactory));
pages.add(new PersistenceUnitPropertiesComposite(subjectHolder, parent, widgetFactory));
// ************Hibernate pages***************
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.ui.wizard;
-import org.eclipse.core.internal.resources.LocationValidator;
-import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@@ -40,8 +38,6 @@
private StringDialogField filename;
- private LocationValidator validator = new LocationValidator((Workspace) ResourcesPlugin.getWorkspace());
-
protected GenerateDdlWizardPage(JpaProject jpaProject) {
super(jpaProject);
}
@@ -103,7 +99,7 @@
}
IStatus status = ResourcesPlugin.getWorkspace().validateName(getFilename(), IResource.FILE);
- if (status.getSeverity() != status.OK){
+ if (status.getSeverity() != IStatus.OK){
setErrorMessage( status.getMessage() );
return;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -30,8 +30,6 @@
private JpaProject jpaProject;
-
- private IStructuredSelection selection;
private GenerateEntitiesWizardPage initPage;
@@ -39,7 +37,6 @@
public GenerateEntitiesWizard( JpaProject jpaProject, IStructuredSelection selection) {
super();
this.jpaProject = jpaProject;
- this.selection = selection;
this.setWindowTitle( JptUiMessages.GenerateEntitiesWizard_generateEntities);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -12,11 +12,8 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.PackageFragmentRoot;
import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil;
import org.eclipse.jdt.internal.corext.util.Messages;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
@@ -32,8 +29,6 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.launch.PathHelper;
-import org.hibernate.util.StringHelper;
-import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
/**
* @author Dmitry Geraskov
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2009-06-02 08:19:13 UTC (rev 15636)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2009-06-02 08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -54,7 +54,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public abstract class GenerateInitWizardPage extends WizardPage {
private static final String AUTODETECT = Messages.GenerateInitWizardPage_autodetect;
15 years, 7 months
JBoss Tools SVN: r15636 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-02 04:19:13 -0400 (Tue, 02 Jun 2009)
New Revision: 15636
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4405
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2009-06-02 07:51:12 UTC (rev 15635)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2009-06-02 08:19:13 UTC (rev 15636)
@@ -79,6 +79,10 @@
if(sp == null) {
return null;
}
+
+ if(sp.hasNoStorage()) {
+ kind = FULL_BUILD;
+ }
long begin = System.currentTimeMillis();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-06-02 07:51:12 UTC (rev 15635)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-06-02 08:19:13 UTC (rev 15636)
@@ -739,6 +739,10 @@
if(f != null && f.isFile()) f.delete();
}
+ public boolean hasNoStorage() {
+ File f = getStorageFile();
+ return f == null || !f.isFile();
+ }
/**
*
* @return
15 years, 7 months
JBoss Tools SVN: r15635 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-06-02 03:51:12 -0400 (Tue, 02 Jun 2009)
New Revision: 15635
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/PersistenceUnitGeneralComposite.java
Log:
Fix https://jira.jboss.org/jira/browse/JBIDE-4404
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/PersistenceUnitGeneralComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/PersistenceUnitGeneralComposite.java 2009-06-02 06:25:56 UTC (rev 15634)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/PersistenceUnitGeneralComposite.java 2009-06-02 07:51:12 UTC (rev 15635)
@@ -169,7 +169,7 @@
* (non-Javadoc)
*/
public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_UNIT_GENERAL;
+ return "org.eclipse.jpt.ui.persistenceUnit_general"; // JBIDE-4404 was before JpaHelpContextIds.PERSISTENCE_UNIT_GENERAL but that disappeared in Eclipse 3.5.RC3, using direct string instead.
}
/*
15 years, 7 months
JBoss Tools SVN: r15634 - in trunk/ws/tests/org.jboss.tools.ws.core.test: projects/ClientTest and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-02 02:25:56 -0400 (Tue, 02 Jun 2009)
New Revision: 15634
Modified:
trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.core.test/projects/ClientTest/.classpath
trunk/ws/tests/org.jboss.tools.ws.core.test/projects/JBossWSTestProject/.classpath
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java
Log:
JBIDE-4350: JBossWSCoreAllTests testWSProviderInvokeCommand and other WS tests fails on hudson
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2009-06-02 05:54:53 UTC (rev 15633)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2009-06-02 06:25:56 UTC (rev 15634)
@@ -38,3 +38,4 @@
org.jboss.tools.ws.core.test.command
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
+Import-Package: org.eclipse.jdt.launching
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/projects/ClientTest/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/projects/ClientTest/.classpath 2009-06-02 05:54:53 UTC (rev 15633)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/projects/ClientTest/.classpath 2009-06-02 06:25:56 UTC (rev 15634)
@@ -4,6 +4,6 @@
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="JBossWS_Runtime/testjbosswsruntime"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JAVA1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/projects/JBossWSTestProject/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/projects/JBossWSTestProject/.classpath 2009-06-02 05:54:53 UTC (rev 15633)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/projects/JBossWSTestProject/.classpath 2009-06-02 06:25:56 UTC (rev 15634)
@@ -1,7 +1,7 @@
<?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/jdk1.5.0_15"/>
+ <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.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2009-06-02 05:54:53 UTC (rev 15633)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2009-06-02 06:25:56 UTC (rev 15634)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.ws.core.test.command;
import java.io.File;
@@ -32,6 +32,8 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.IStreamListener;
import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
@@ -53,28 +55,32 @@
import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.IServer.IOperationListener;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
import org.jboss.tools.common.test.util.TestProjectProvider;
-import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
public abstract class AbstractJBossWSCommandTest extends TestCase {
+ public static final IVMInstall VM_INSTALL = JavaRuntime
+ .getDefaultVMInstall();
protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
protected static final IWorkbench wb = PlatformUI.getWorkbench();
-
+
protected static final int DEFAULT_STARTUP_TIME = 150000;
protected static final int DEFAULT_SHUTDOWN_TIME = 90000;
- protected static final String JBOSSWS_HOME_DEFAULT = "/home/fugang/jboss-all/jboss-soa-p.4.3.0/jboss-as";
- public static final String JBOSSWS_42_HOME="jbosstools.test.jboss.home.4.2";
+ protected static final String JBOSSWS_HOME_DEFAULT = "D:/softinstall/jboss-4.2.3GA/jboss-4.2.3.GA";
+ public static final String JBOSSWS_42_HOME = "jbosstools.test.jboss.home.4.2";
public static final String JBOSS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
- public static final String JBOSS_AS_42_HOME = System.getProperty(JBOSSWS_42_HOME, JBOSSWS_HOME_DEFAULT);
+ public static final String JBOSS_AS_42_HOME = System.getProperty(
+ JBOSSWS_42_HOME, JBOSSWS_HOME_DEFAULT);
public static final String JBOSS_SERVER_42 = "org.jboss.ide.eclipse.as.42";
-
+
protected final Set<IResource> resourcesToCleanup = new HashSet<IResource>();
protected static final IProjectFacetVersion dynamicWebVersion;
@@ -84,88 +90,84 @@
static String wsdlFileName = "hello_world.wsdl";
static String BUNDLE = "org.jboss.tools.ws.core.test";
-
+
IFacetedProject fproject;
- TestProjectProvider provider;
protected IRuntime currentRuntime;
protected IServer currentServer;
-
+ protected ServerStateListener stateListener;
+
static {
- javaVersion = ProjectFacetsManager.getProjectFacet("jst.java").getVersion("5.0");
- dynamicWebVersion = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.5");
+ javaVersion = ProjectFacetsManager.getProjectFacet("jst.java")
+ .getVersion("5.0");
+ dynamicWebVersion = ProjectFacetsManager.getProjectFacet("jst.web")
+ .getVersion("2.5");
jbosswsFacet = ProjectFacetsManager.getProjectFacet("jbossws.core");
jbosswsFacetVersion = jbosswsFacet.getVersion("2.0");
-
-
+
}
public AbstractJBossWSCommandTest() {
}
-
+
protected void setUp() throws Exception {
super.setUp();
-
- //create jbossws web project
-
- createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME, "default");
-
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- JUnitUtils.fail(e.getMessage(), e);
- }
-
+
+ // create jbossws web project
+
+ createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME,
+ "default");
+ // first thing's first. Let's add a server state listener
+ stateListener = new ServerStateListener();
+ currentServer.addServerListener(stateListener);
+
JobUtils.delay(3000);
}
-
+
public IProject createProject(String prjName) throws CoreException {
- provider = new TestProjectProvider(BUNDLE,"/projects/"+prjName , prjName, true);
+ TestProjectProvider provider = new TestProjectProvider(BUNDLE, "/projects/" + prjName,
+ prjName, true);
IProject prj = provider.getProject();
- JobUtils.waitForIdle();
return prj;
}
-
-
protected void tearDown() throws Exception {
// Wait until all jobs is finished to avoid delete project problems
-
+
undeployWebProject();
- boolean oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
- Exception last = null;
-
- try {
- JobUtils.waitForIdle();
-
+ boolean oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
+ Exception last = null;
+
+ try {
+ JobUtils.delay(500);
for (IResource r : this.resourcesToCleanup) {
try {
System.out.println("Deleting " + r);
r.delete(true, null);
- JobUtils.waitForIdle();
- } catch(Exception e) {
+ JobUtils.delay(500);
+ } catch (Exception e) {
System.out.println("Error deleting " + r);
e.printStackTrace();
last = e;
}
}
- } finally {
- ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
- }
-
- if(last!=null) throw last;
-
+ } finally {
+ ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
+ }
+
+ if (last != null)
+ throw last;
+
resourcesToCleanup.clear();
-
- //cleanProjectFromServer() ;
+ // cleanProjectFromServer() ;
shutdown();
+ currentServer.removeServerListener(stateListener);
currentRuntime.delete();
currentServer.delete();
-
+
super.tearDown();
}
-
protected void createServer(String runtimeID, String serverID,
String location, String configuration) throws CoreException {
// if file doesnt exist, abort immediately.
@@ -178,10 +180,12 @@
serverWC.setRuntime(currentRuntime);
serverWC.setName(serverID);
serverWC.setServerConfiguration(null);
- IPath path = new Path(location).append("server").append("default").append("deploy");
- ((ServerWorkingCopy)serverWC).setAttribute(DeployableServer.DEPLOY_DIRECTORY, path.toOSString() );
+ IPath path = new Path(location).append("server").append("default")
+ .append("deploy");
+ ((ServerWorkingCopy) serverWC).setAttribute(
+ DeployableServer.DEPLOY_DIRECTORY, path.toOSString());
currentServer = serverWC.save(true, new NullProgressMonitor());
-
+
}
private IRuntime createRuntime(String runtimeId, String homeDir,
@@ -194,11 +198,18 @@
new NullProgressMonitor());
runtimeWC.setName(runtimeId);
runtimeWC.setLocation(new Path(homeDir));
+ ((RuntimeWorkingCopy) runtimeWC).setAttribute(
+ IJBossServerRuntime.PROPERTY_VM_ID, VM_INSTALL.getId());
+ ((RuntimeWorkingCopy) runtimeWC).setAttribute(
+ IJBossServerRuntime.PROPERTY_VM_TYPE_ID, VM_INSTALL
+ .getVMInstallType().getId());
+ ((RuntimeWorkingCopy) runtimeWC).setAttribute(
+ IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, config);
IRuntime savedRuntime = runtimeWC.save(true, new NullProgressMonitor());
return savedRuntime;
}
-
- protected ServiceModel createServiceModel(){
+
+ protected ServiceModel createServiceModel() {
ServiceModel model = new ServiceModel();
model.setWebProjectName(fproject.getProject().getName());
IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
@@ -206,159 +217,133 @@
model.addServiceName("SOAPService");
model.addPortTypes("Greeter");
model.setCustomPackage("org.apache.hello_world_soap_http");
-
+
return model;
-
+
}
-
- protected void publishWebProject() throws CoreException{
- IModule[] modules = ServerUtil.getModules(currentServer.getServerType().getRuntimeType().getModuleTypes());
+
+ protected void publishWebProject() throws CoreException {
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType()
+ .getRuntimeType().getModuleTypes());
IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
serverWC.modifyModules(modules, null, null);
serverWC.save(true, null).publish(0, null);
currentServer.publish(IServer.PUBLISH_FULL, null);
-
+
}
-
- protected void undeployWebProject() throws CoreException{
- IModule[] modules = ServerUtil.getModules(currentServer.getServerType().getRuntimeType().getModuleTypes());
+
+ protected void undeployWebProject() throws CoreException {
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType()
+ .getRuntimeType().getModuleTypes());
IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
- serverWC.modifyModules( null,modules, null);
+ serverWC.modifyModules(null, modules, null);
serverWC.save(true, null).publish(0, null);
currentServer.publish(IServer.PUBLISH_FULL, null);
-
+
}
-
- protected void cleanProjectFromServer() throws CoreException{
- IModule[] modules = ServerUtil.getModules(currentServer.getServerType().getRuntimeType().getModuleTypes());
+
+ protected void cleanProjectFromServer() throws CoreException {
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType()
+ .getRuntimeType().getModuleTypes());
IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
serverWC.modifyModules(null, modules, null);
currentServer.publish(0, null);
currentServer.stop(true);
-
+
}
-
- protected boolean isServerSupplied(){
+
+ protected boolean isServerSupplied() {
return false;
}
-
-
- protected IFacetedProject createJBossWSProject(String baseProjectName, boolean isServerSupplied) throws CoreException {
+
+ protected IFacetedProject createJBossWSProject(String baseProjectName,
+ boolean isServerSupplied) throws CoreException {
IProject project = createProject(baseProjectName);
final IFacetedProject fproj = ProjectFacetsManager.create(project);
-
- //installDependentFacets(fproj);
- fproj.installProjectFacet(jbosswsFacetVersion, createJBossWSDataModel(isServerSupplied), null);
-
+
+ // installDependentFacets(fproj);
+ fproj.installProjectFacet(jbosswsFacetVersion,
+ createJBossWSDataModel(isServerSupplied), null);
+
assertNotNull(project);
- this.addResourceToCleanup(project);
-
-
+ this.addResourceToCleanup(project);
+
return fproj;
}
-
- abstract IDataModel createJBossWSDataModel( boolean isServerSupplied);
+ abstract IDataModel createJBossWSDataModel(boolean isServerSupplied);
-
-
protected final void addResourceToCleanup(final IResource resource) {
this.resourcesToCleanup.add(resource);
}
+ protected File getJBossWSHomeFolder() {
+ String jbosshome = System.getProperty(JBOSSWS_42_HOME,
+ JBOSSWS_HOME_DEFAULT);
+ File runtimelocation = new File(jbosshome);
+ assertTrue("Please set JBoss EAP Home in system property:"
+ + JBOSSWS_42_HOME, runtimelocation.exists());
-
- protected File getJBossWSHomeFolder() {
-
- String jbosshome = System.getProperty(JBOSSWS_42_HOME, JBOSSWS_HOME_DEFAULT);
- File runtimelocation = new File(jbosshome);
- assertTrue("Please set JBoss EAP Home in system property:" + JBOSSWS_42_HOME, runtimelocation.exists());
-
- String cmdFileLocation = jbosshome + File.separator + "bin" + File.separator + "wsconsume.sh";
- assertTrue(jbosshome + " is not a valid jboss EAP home", new File(cmdFileLocation).exists());
+ String cmdFileLocation = jbosshome + File.separator + "bin"
+ + File.separator + "wsconsume.sh";
+ assertTrue(jbosshome + " is not a valid jboss EAP home", new File(
+ cmdFileLocation).exists());
return runtimelocation;
}
-
-
-
- protected class ServerStateListener implements IServerListener {
- private ArrayList stateChanges;
- public ServerStateListener() {
- this.stateChanges = new ArrayList();
- }
- public ArrayList getStateChanges() {
- return stateChanges;
- }
- public void serverChanged(ServerEvent event) {
- if((event.getKind() & ServerEvent.SERVER_CHANGE) != 0) {
- if((event.getKind() & ServerEvent.STATE_CHANGE) != 0) {
- if( event.getState() != IServer.STATE_STOPPED)
- stateChanges.add(new Integer(event.getState()));
- }
- }
- }
+ protected void startup() {
+ startup(DEFAULT_STARTUP_TIME);
}
-
- protected class ErrorStreamListener implements IStreamListener {
- protected boolean errorFound = false;
- String entireLog = "";
- public void streamAppended(String text, IStreamMonitor monitor) {
- entireLog += text;
- }
-
- // will need to be fixed or decided how to figure out errors
- public boolean hasError() {
- return errorFound;
- }
- }
- protected void startup() { startup(DEFAULT_STARTUP_TIME); }
protected void startup(int maxWait) {
long finishTime = new Date().getTime() + maxWait;
-
+
// operation listener, which is only alerted when the startup is *done*
final StatusWrapper opWrapper = new StatusWrapper();
final IOperationListener listener = new IOperationListener() {
public void done(IStatus result) {
opWrapper.setStatus(result);
- } };
-
-
+ }
+ };
+
// a stream listener to listen for errors
ErrorStreamListener streamListener = new ErrorStreamListener();
-
+
// the thread to actually start the server
- Thread startThread = new Thread() {
+ Thread startThread = new Thread() {
public void run() {
currentServer.start(ILaunchManager.RUN_MODE, listener);
}
};
-
+
startThread.start();
-
+
boolean addedStream = false;
- while( finishTime > new Date().getTime() && opWrapper.getStatus() == null) {
+ while (finishTime > new Date().getTime()
+ && opWrapper.getStatus() == null) {
// we're waiting for startup to finish
- if( !addedStream ) {
+ if (!addedStream) {
IStreamMonitor mon = getStreamMonitor();
- if( mon != null ) {
+ if (mon != null) {
mon.addListener(streamListener);
addedStream = true;
}
}
try {
Display.getDefault().readAndDispatch();
- } catch( SWTException swte ) {}
+ } catch (SWTException swte) {
+ }
}
-
+
try {
- assertTrue("Startup has taken longer than what is expected for a default startup", finishTime >= new Date().getTime());
- assertNotNull("Startup never finished", opWrapper.getStatus());
- assertFalse("Startup had System.error output", streamListener.hasError());
- } catch( AssertionFailedError afe ) {
+ assertTrue(
+ "Startup has taken longer than what is expected for a default startup",
+ finishTime >= new Date().getTime());
+ assertFalse("Startup had System.error output", streamListener
+ .hasError());
+ } catch (AssertionFailedError afe) {
// cleanup
currentServer.stop(true);
// rethrow
@@ -367,66 +352,115 @@
getStreamMonitor().removeListener(streamListener);
}
- protected void shutdown() { shutdown(DEFAULT_SHUTDOWN_TIME); }
+ protected void shutdown() {
+ shutdown(DEFAULT_SHUTDOWN_TIME);
+ }
+
protected void shutdown(int maxWait) {
long finishTime = new Date().getTime() + maxWait;
-
+
// operation listener, which is only alerted when the startup is *done*
final StatusWrapper opWrapper = new StatusWrapper();
final IOperationListener listener = new IOperationListener() {
public void done(IStatus result) {
opWrapper.setStatus(result);
- } };
-
-
+ }
+ };
+
// a stream listener to listen for errors
ErrorStreamListener streamListener = new ErrorStreamListener();
- if( getStreamMonitor() != null )
+ if (getStreamMonitor() != null)
getStreamMonitor().addListener(streamListener);
-
+
// the thread to actually start the server
- Thread stopThread = new Thread() {
+ Thread stopThread = new Thread() {
public void run() {
currentServer.stop(false, listener);
}
};
-
+
stopThread.start();
-
- while( finishTime > new Date().getTime() && opWrapper.getStatus() == null) {
+
+ while (finishTime > new Date().getTime()
+ && opWrapper.getStatus() == null) {
// we're waiting for startup to finish
try {
Display.getDefault().readAndDispatch();
- } catch( SWTException swte ) {}
+ } catch (SWTException swte) {
+ }
}
-
+
try {
- assertTrue("Startup has taken longer than what is expected for a default startup", finishTime >= new Date().getTime());
- assertNotNull("Startup never finished", opWrapper.getStatus());
- assertFalse("Startup had System.error output", streamListener.hasError());
- } catch( AssertionFailedError afe ) {
+ assertTrue(
+ "Startup has taken longer than what is expected for a default startup",
+ finishTime >= new Date().getTime());
+ assertFalse("Startup had System.error output", streamListener
+ .hasError());
+ } catch (AssertionFailedError afe) {
// cleanup
currentServer.stop(true);
// rethrow
throw afe;
}
}
-
+
protected IStreamMonitor getStreamMonitor() {
- JBossServerBehavior behavior =
- (JBossServerBehavior)currentServer.loadAdapter(JBossServerBehavior.class, null);
- if( behavior != null ) {
- if( behavior.getProcess() != null ) {
- return behavior.getProcess().getStreamsProxy().getOutputStreamMonitor();
+ JBossServerBehavior behavior = (JBossServerBehavior) currentServer
+ .loadAdapter(JBossServerBehavior.class, null);
+ if (behavior != null) {
+ if (behavior.getProcess() != null) {
+ return behavior.getProcess().getStreamsProxy()
+ .getOutputStreamMonitor();
}
}
return null;
}
-
+
+ protected class ServerStateListener implements IServerListener {
+ private ArrayList stateChanges;
+
+ public ServerStateListener() {
+ this.stateChanges = new ArrayList();
+ }
+
+ public ArrayList getStateChanges() {
+ return stateChanges;
+ }
+
+ public void serverChanged(ServerEvent event) {
+ if ((event.getKind() & ServerEvent.SERVER_CHANGE) != 0) {
+ if ((event.getKind() & ServerEvent.STATE_CHANGE) != 0) {
+ if (event.getState() != IServer.STATE_STOPPED)
+ stateChanges.add(new Integer(event.getState()));
+ }
+ }
+ }
+ }
+
+ protected class ErrorStreamListener implements IStreamListener {
+ protected boolean errorFound = false;
+ String entireLog = "";
+
+ public void streamAppended(String text, IStreamMonitor monitor) {
+ entireLog += text;
+ }
+
+ // will need to be fixed or decided how to figure out errors
+ public boolean hasError() {
+ return errorFound;
+ }
+ }
+
public class StatusWrapper {
protected IStatus status;
- public IStatus getStatus() { return this.status; }
- public void setStatus(IStatus s) { this.status = s; }
+
+ public IStatus getStatus() {
+ return this.status;
+ }
+
+ public void setStatus(IStatus s) {
+ this.status = s;
+ }
}
}
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java 2009-06-02 05:54:53 UTC (rev 15633)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/JBossWSJavaFirstCommandTest.java 2009-06-02 06:25:56 UTC (rev 15634)
@@ -65,6 +65,7 @@
protected static final String JBOSSWS_HOME_DEFAULT = "D:\\softinstall\\jboss-4.2.3GA\\jboss-4.2.3.GA";
private static final String RuntimeName;
private static final boolean isDeployed;
+ private IProject clientProject;
static {
RuntimeName = "testjbosswsruntime";
@@ -82,7 +83,8 @@
// create jbossws web project
fproject = createJBossWSProject("JavaFirstTestProject",
isServerSupplied());
-
+ clientProject = createProject("ClientTest");
+ this.addResourceToCleanup(clientProject);
}
protected void tearDown() throws Exception {
@@ -125,7 +127,7 @@
}
- public void testWSProviderInvokeCommand() throws ExecutionException, CoreException {
+ public void testJava2WSCommand() throws ExecutionException, CoreException {
ServiceModel model = new ServiceModel();
model.setWebProjectName(fproject.getProject().getName());
@@ -190,7 +192,6 @@
conn.connect();
conn.getContent();
- IProject pro = createProject("ClientTest");
model = new ServiceModel();
model.setWebProjectName("ClientTest");
@@ -198,8 +199,8 @@
status = cmd.execute(null, null);
assertTrue(status.getMessage(), status.isOK());
- pro.open(null);
- pro.refreshLocal(IResource.DEPTH_INFINITE, null);
+ clientProject.open(null);
+ clientProject.refreshLocal(IResource.DEPTH_INFINITE, null);
ILaunchManager launchManager = DebugPlugin.getDefault()
.getLaunchManager();
15 years, 7 months
JBoss Tools SVN: r15633 - trunk/freemarker/releng/psfs.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-02 01:54:53 -0400 (Tue, 02 Jun 2009)
New Revision: 15633
Added:
trunk/freemarker/releng/psfs/project.subclipse.psf
trunk/freemarker/releng/psfs/project.subversive.psf
Removed:
trunk/freemarker/releng/psfs/project.subclipse.psf
trunk/freemarker/releng/psfs/project.subversive.psf
Log:
https://jira.jboss.org/jira/browse/JBDS-747 generated psfs
Deleted: trunk/freemarker/releng/psfs/project.subclipse.psf
===================================================================
--- trunk/freemarker/releng/psfs/project.subclipse.psf 2009-06-02 05:22:14 UTC (rev 15632)
+++ trunk/freemarker/releng/psfs/project.subclipse.psf 2009-06-02 05:54:53 UTC (rev 15633)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<psf version="2.0">
-<provider id="org.tigris.subversion.subclipse.core.svnnature">
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/freemarker/featur..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/freemarker/plugin...</provider>,org.jboss.ide.eclipse.freemarker"/>
-</psf>
Added: trunk/freemarker/releng/psfs/project.subclipse.psf
===================================================================
--- trunk/freemarker/releng/psfs/project.subclipse.psf (rev 0)
+++ trunk/freemarker/releng/psfs/project.subclipse.psf 2009-06-02 05:54:53 UTC (rev 15633)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.tigris.subversion.subclipse.core.svnnature">
+
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/freemarker/features..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/freemarker/plugins/..."/>
+</provider>
+</psf>
Deleted: trunk/freemarker/releng/psfs/project.subversive.psf
===================================================================
--- trunk/freemarker/releng/psfs/project.subversive.psf 2009-06-02 05:22:14 UTC (rev 15632)
+++ trunk/freemarker/releng/psfs/project.subversive.psf 2009-06-02 05:54:53 UTC (rev 15633)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<psf version="2.0">
-<provider id="org.eclipse.team.svn.core.svnnature">
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/freemarker/featur..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/freemarker/plugin...</provider>,org.jboss.ide.eclipse.freemarker"/>
-</psf>
Added: trunk/freemarker/releng/psfs/project.subversive.psf
===================================================================
--- trunk/freemarker/releng/psfs/project.subversive.psf (rev 0)
+++ trunk/freemarker/releng/psfs/project.subversive.psf 2009-06-02 05:54:53 UTC (rev 15633)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.eclipse.team.svn.core.svnnature">
+
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/freemarker/features..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/freemarker/plugins/..."/>
+</provider>
+</psf>
15 years, 7 months
JBoss Tools SVN: r15631 - trunk/jmx/releng/psfs.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-02 00:37:23 -0400 (Tue, 02 Jun 2009)
New Revision: 15631
Added:
trunk/jmx/releng/psfs/releng.subclipse.psf
trunk/jmx/releng/psfs/releng.subversive.psf
Log:
add .psfs for .releng project
Added: trunk/jmx/releng/psfs/releng.subclipse.psf
===================================================================
--- trunk/jmx/releng/psfs/releng.subclipse.psf (rev 0)
+++ trunk/jmx/releng/psfs/releng.subclipse.psf 2009-06-02 04:37:23 UTC (rev 15631)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.tigris.subversion.subclipse.core.svnnature">
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/jmx/releng,org.jbos..."/>
+</provider>
+</psf>
Property changes on: trunk/jmx/releng/psfs/releng.subclipse.psf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/psfs/releng.subversive.psf
===================================================================
--- trunk/jmx/releng/psfs/releng.subversive.psf (rev 0)
+++ trunk/jmx/releng/psfs/releng.subversive.psf 2009-06-02 04:37:23 UTC (rev 15631)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.eclipse.team.svn.core.svnnature">
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/jmx/releng,org.jbos..."/>
+</provider>
+</psf>
Property changes on: trunk/jmx/releng/psfs/releng.subversive.psf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r15630 - in trunk/jmx/releng: maps and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-01 18:32:53 -0400 (Mon, 01 Jun 2009)
New Revision: 15630
Added:
trunk/jmx/releng/maps/project.map
trunk/jmx/releng/psfs/project.subclipse.psf
trunk/jmx/releng/psfs/project.subversive.psf
Removed:
trunk/jmx/releng/maps/jmx.map
trunk/jmx/releng/psfs/jmx.subclipse.psf
trunk/jmx/releng/psfs/jmx.subversive.psf
Modified:
trunk/jmx/releng/build.properties
trunk/jmx/releng/build.xml
Log:
refactor and update comments
Modified: trunk/jmx/releng/build.properties
===================================================================
--- trunk/jmx/releng/build.properties 2009-06-01 22:16:58 UTC (rev 15629)
+++ trunk/jmx/releng/build.properties 2009-06-01 22:32:53 UTC (rev 15630)
@@ -1,12 +1,13 @@
## BEGIN PROJECT BUILD PROPERTIES ##
+# this property allows ant-contrib and pde-svn-plugin to be fetched and installed automatically for you
thirdPartyDownloadLicenseAcceptance="I accept"
projectid=jbosstools.jmx
zipPrefix=JMX
incubation=
buildType=N
-version=1.0.0
+version=1.1.0
mainFeatureToBuildID=org.jboss.tools.jmx.sdk.feature
testFeatureToBuildID=org.jboss.tools.jmx.tests.feature
Modified: trunk/jmx/releng/build.xml
===================================================================
--- trunk/jmx/releng/build.xml 2009-06-01 22:16:58 UTC (rev 15629)
+++ trunk/jmx/releng/build.xml 2009-06-01 22:32:53 UTC (rev 15630)
@@ -1,26 +1,11 @@
-<project default="run" name="org.jboss.tools.jmx.releng/build.xml - Run a JMX build using the Athena CBI">
+<project default="run" name="org.jboss.tools.*.releng/build.xml - Run a JBoss Tools component build using the Athena CBI">
<target name="run">
<!--
- 1. You must check out the following projects to your workspace:
+ You must check out the following projects to your workspace:
org.eclipse.releng.basebuilder
org.eclipse.dash.common.releng
- org.eclipse.myproject.releng
-
- 2. You must provide Ant-Contrib in one of four places:
-
- org.eclipse.dash.common.releng/lib/ant-contrib.jar
- org.eclipse.myproject.releng/lib/ant-contrib.jar
- ${thirdPartyJarsDir}/ant-contrib.jar (path can be customized below)
- /usr/share/java/ant-contrib.jar (may require a symlink)
-
- You can install Ant-Contrib via RPM, or download it here:
-
- http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636
-
- 3. If your project's sources are in SVN, you must unpack this zip into the basebuilder project's plugins/ folder:
-
- http://downloads.sourceforge.net/svn-pde-build/org.eclipse.pde.build.svn-...
+ jbosstools/trunk/<your component>/releng
-->
<!-- load properties and set timestamp for the build -->
Deleted: trunk/jmx/releng/maps/jmx.map
===================================================================
--- trunk/jmx/releng/maps/jmx.map 2009-06-01 22:16:58 UTC (rev 15629)
+++ trunk/jmx/releng/maps/jmx.map 2009-06-01 22:32:53 UTC (rev 15630)
@@ -1,9 +0,0 @@
-feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature
-feature@org.jboss.tools.jmx.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.feature
-feature@org.jboss.tools.jmx.tests.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.tests.feature
-
-plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core
-plugin@org.jboss.tools.jmx.ui=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.ui
-plugin@org.jboss.tools.jmx.core.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.core.test
-plugin@org.jboss.tools.jmx.ui.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test
-plugin@org.jboss.tools.jmx.ui.test.interactive=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test.interactive
Copied: trunk/jmx/releng/maps/project.map (from rev 15565, trunk/jmx/releng/maps/jmx.map)
===================================================================
--- trunk/jmx/releng/maps/project.map (rev 0)
+++ trunk/jmx/releng/maps/project.map 2009-06-01 22:32:53 UTC (rev 15630)
@@ -0,0 +1,9 @@
+feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature
+feature@org.jboss.tools.jmx.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.feature
+feature@org.jboss.tools.jmx.tests.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.tests.feature
+
+plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core
+plugin@org.jboss.tools.jmx.ui=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.ui
+plugin@org.jboss.tools.jmx.core.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.core.test
+plugin@org.jboss.tools.jmx.ui.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test
+plugin@org.jboss.tools.jmx.ui.test.interactive=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test.interactive
Property changes on: trunk/jmx/releng/maps/project.map
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/jmx/releng/psfs/jmx.subclipse.psf
===================================================================
--- trunk/jmx/releng/psfs/jmx.subclipse.psf 2009-06-01 22:16:58 UTC (rev 15629)
+++ trunk/jmx/releng/psfs/jmx.subclipse.psf 2009-06-01 22:32:53 UTC (rev 15630)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<psf version="2.0">
-<provider id="org.tigris.subversion.subclipse.core.svnnature">
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
-
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
-</provider>
-</psf>
Deleted: trunk/jmx/releng/psfs/jmx.subversive.psf
===================================================================
--- trunk/jmx/releng/psfs/jmx.subversive.psf 2009-06-01 22:16:58 UTC (rev 15629)
+++ trunk/jmx/releng/psfs/jmx.subversive.psf 2009-06-01 22:32:53 UTC (rev 15630)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<psf version="2.0">
-<provider id="org.eclipse.team.svn.core.svnnature">
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
-
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
-</provider>
-</psf>
Copied: trunk/jmx/releng/psfs/project.subclipse.psf (from rev 15628, trunk/jmx/releng/psfs/jmx.subclipse.psf)
===================================================================
--- trunk/jmx/releng/psfs/project.subclipse.psf (rev 0)
+++ trunk/jmx/releng/psfs/project.subclipse.psf 2009-06-01 22:32:53 UTC (rev 15630)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.tigris.subversion.subclipse.core.svnnature">
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
+
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
+</provider>
+</psf>
Property changes on: trunk/jmx/releng/psfs/project.subclipse.psf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jmx/releng/psfs/project.subversive.psf (from rev 15628, trunk/jmx/releng/psfs/jmx.subversive.psf)
===================================================================
--- trunk/jmx/releng/psfs/project.subversive.psf (rev 0)
+++ trunk/jmx/releng/psfs/project.subversive.psf 2009-06-01 22:32:53 UTC (rev 15630)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.eclipse.team.svn.core.svnnature">
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/features/org...."/>
+
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/plugins/org.j..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos///jbosstools/trunk/jmx/tests/org.jbo..."/>
+</provider>
+</psf>
Property changes on: trunk/jmx/releng/psfs/project.subversive.psf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r15629 - trunk/jmx/releng/psfs.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-01 18:16:58 -0400 (Mon, 01 Jun 2009)
New Revision: 15629
Removed:
trunk/jmx/releng/psfs/jmx.psf
Log:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=278687 replace with generated .psfs
Deleted: trunk/jmx/releng/psfs/jmx.psf
===================================================================
--- trunk/jmx/releng/psfs/jmx.psf 2009-06-01 22:16:45 UTC (rev 15628)
+++ trunk/jmx/releng/psfs/jmx.psf 2009-06-01 22:16:58 UTC (rev 15629)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<psf version="2.0">
-<provider id="org.tigris.subversion.subclipse.core.svnnature">
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.t..."/>
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.t..."/>
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.to..."/>
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.to..."/>
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
-<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
-</provider>
-</psf>
\ No newline at end of file
15 years, 7 months