Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 163008 Details for
Bug 307033
IllegalArgumentException when recording using a workspace with different URI schemes.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch.
Defect_307033_patch.txt (text/plain), 27.26 KB, created by
Paul Slauenwhite
on 2010-03-25 12:05:23 EDT
(
hide
)
Description:
Patch.
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2010-03-25 12:05:23 EDT
Size:
27.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.test.core >Index: src/org/eclipse/hyades/internal/execution/recorder/utilities/RecorderFileUtil.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/hyades/internal/execution/recorder/utilities/RecorderFileUtil.java,v >retrieving revision 1.8 >diff -u -r1.8 RecorderFileUtil.java >--- src/org/eclipse/hyades/internal/execution/recorder/utilities/RecorderFileUtil.java 18 Nov 2009 18:48:29 -0000 1.8 >+++ src/org/eclipse/hyades/internal/execution/recorder/utilities/RecorderFileUtil.java 25 Mar 2010 15:59:10 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2009 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,181 +10,140 @@ > * IBM Corporation - initial API and implementation > **********************************************************************/ > package org.eclipse.hyades.internal.execution.recorder.utilities; >-import java.io.ByteArrayInputStream; >-import java.io.IOException; >-import java.util.HashMap; >-import java.util.Map; >+ >+import java.io.File; > > import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.ResourcesPlugin; >-import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.NullProgressMonitor; >-import org.eclipse.core.runtime.Path; >-import org.eclipse.core.runtime.Platform; >-import org.eclipse.emf.common.util.URI; >-import org.eclipse.emf.ecore.EObject; >-import org.eclipse.emf.ecore.resource.Resource; >-import org.eclipse.emf.ecore.resource.ResourceSet; >-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; >-import org.eclipse.emf.ecore.xmi.XMIResource; >-import org.eclipse.hyades.models.trace.TRCSourceInfo; >-import org.eclipse.hyades.models.trace.impl.TraceFactoryImpl; >+ > /** >- * @author amathur >- * @author Jerome Bozier >- * @version November 17, 2009 >- * >- * To change the template for this generated type comment go to >- * Window>Preferences>Java>Code Generation>Code and Comments >+ * <p>Utilities for recording files.</p> >+ * >+ * >+ * @author Ashish Mathur >+ * @author Jerome Bozier >+ * @author Paul Slauenwhite >+ * @version March 25, 2010 >+ * @since September 23, 2005 > */ > public class RecorderFileUtil { >- >- public static IFile createTraceFile(String filepath) throws CoreException >- { >- >- String recFilePath = filepath; >- IFile file = null; >- try >- { >- if (!recFilePath.endsWith(".rec")) { //$NON-NLS-1$ >- recFilePath += ".rec"; //$NON-NLS-1$ >- } >- >- file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(recFilePath)); >- >- if(file.exists()) >- { >- file.delete(true,true,null); >- } >- >- file.create(new ByteArrayInputStream(new byte[] {}), true, new NullProgressMonitor()); >- >- >- >+ >+ /** >+ * <p>Determines if the {@link IFile} exists in the workspace or local file system.</p> >+ * >+ * @param iFile The {@link IFile} to be checked. >+ * @return <code>true</code> if the {@link IFile} exists in the workspace or local file system, otherwise <code>false</code>. >+ */ >+ public static boolean fileExists(IFile iFile){ >+ >+ //Workspace file check: >+ if (iFile.exists()){ >+ return true; > } >- catch (RuntimeException e) { >- e.printStackTrace(); >+ >+ //File system file check: >+ else{ >+ >+ IPath iFilePath = iFile.getLocation(); >+ >+ if (iFilePath != null){ >+ return (iFilePath.toFile().exists()); >+ } > } > >- return file; >+ return false; > } > >- public static IFile createTraceModel(String recModelPath, String recFilePath) { >- Map RESOURCE_OPTIONS = new HashMap(); >- RESOURCE_OPTIONS.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE); >- RESOURCE_OPTIONS.put(XMIResource.OPTION_SKIP_ESCAPE, Boolean.FALSE); >- RESOURCE_OPTIONS.put(XMIResource.OPTION_ENCODING, "UTF-8"); >- TRCSourceInfo si = TraceFactoryImpl.eINSTANCE.createTRCSourceInfo(); >- //URI testSuiteURI = EcoreUtil.getURI(tpfSuite); >- //URI uri = tpfSuite.eResource().getURI().trimFileExtension(); >- >- if (recModelPath.endsWith(".rec")) { //$NON-NLS-1$ >- recModelPath += "model"; //$NON-NLS-1$ >- } >- else if (!recModelPath.endsWith(".recmodel")) { //$NON-NLS-1$ >- recModelPath += ".recmodel"; //$NON-NLS-1$ >- } >- >+ /** >+ * <p>Deletes the recording {@link IFile} if it exists in the workspace or local file system.</p> >+ * >+ * <p>If the recording {@link IFile} was successfully deleted, the recording {@link IFile}'s parent container is refreshed.</p> >+ * >+ * <p>If the recording {@link IFile} ends with the <code>.recmodel</code> file extension, the recording model {@link IFile} >+ * (<code>*.recmodel</code>) is deleted and the recording {@link IFile}'s parent container is refreshed.</p> >+ * >+ * @param iFile The recording {@link IFile} to be deleted. >+ * @return <code>true</code> if the recording {@link IFile} and possible recording model {@link IFile} were successfully deleted, otherwise <code>false</code>. >+ */ >+ public static boolean deleteRecordingFile(IFile recordingFile){ > >- URI modelURI = URI.createPlatformResourceURI(recModelPath,true); >- si.setLocation(recFilePath); >- ResourceSet rs = new ResourceSetImpl(); >- Resource resource = rs.createResource(modelURI); >- resource.getContents().add(si); >- >- //TODO handle situation where file already exists. >- try { >- resource.save(RESOURCE_OPTIONS); >- } >- catch (IOException e) { >- e.printStackTrace(); >- } >- >- return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(recModelPath)); >+ boolean isSuccessful = false; > >- >- } >- public static EObject[] loadResource(IFile file) { >- // Create a resource set before loading anything >- ResourceSet resourceSet = new ResourceSetImpl(); >- Resource resource = >- resourceSet.getResource( >- URI.createPlatformResourceURI(file.getFullPath().toString(),true), >- true); >- if (resource == null) { >- System.out.println("Failed to get the resource"); //$NON-NLS-1$ >- return null; >+ if(recordingFile != null){ >+ >+ isSuccessful = deleteFile(recordingFile); >+ >+ if(isSuccessful){ >+ >+ IPath iFilePath = recordingFile.getFullPath(); >+ >+ if("rec".equals(iFilePath.getFileExtension())){ //$NON-NLS-1$ >+ isSuccessful = deleteFile(ResourcesPlugin.getWorkspace().getRoot().getFile(iFilePath.removeFileExtension().addFileExtension("recmodel"))); //$NON-NLS-1$ >+ } >+ } > } >- // Retrieve an array of root elements in this file. In this case, there is really only >- // one TRCSourceInfo element. >- EObject[] elements = >- (EObject[]) resource.getContents().toArray( >- new EObject[resource.getContents().size()]); >- return elements; >+ >+ return isSuccessful; > } >+ > /** >- * @param file >+ * <p>Deletes the {@link IFile} if it exists in the workspace or local file system.</p> >+ * >+ * <p>If the {@link IFile} was successfully deleted, the {@link IFile}'s parent container is refreshed.</p> >+ * >+ * @param iFile The {@link IFile} to be deleted. >+ * @return <code>true</code> if the {@link IFile} was successfully deleted, otherwise <code>false</code>. > */ >- public static IFile getTraceFile(IFile file) { >- EObject[] elements = RecorderFileUtil.loadResource(file); >- TRCSourceInfo tsi = (TRCSourceInfo) elements[0]; >- // Get the location attribute >- String location = tsi.getLocation(); >- System.out.println("Trace file: " + location); //$NON-NLS-1$ >- // Find and open the trace file >- IFile traceFile = >- (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember( >- location); >- return traceFile; >- } >- >- public static boolean fileExists(IFile wsFile) >- { >- if (wsFile.exists()) >- return true; >- if (Platform.getOS().equals("win32")) >- { //although the IFile does not exist in the workspace (it is case-sensitive) >- //it may still be impossible to create the file in case-insensitive >- java.net.URI uri = wsFile.getRawLocationURI(); >- if (uri == null) //probably because project doesn't exist >- return false; >- java.io.File file = new java.io.File(uri); >- return file.exists(); >- >- } >- return false; >- } >- >- public static boolean deleteFiles(IFile recFile, IFile tgFile) >- { >- if (!(Platform.getOS().equals("win32"))) >- return false; //don't bother, since the case-insensitive delete is only required on Windows >- if (recFile != null) >- { >- java.io.File javaFile = new java.io.File(recFile.getRawLocationURI()); >- javaFile.delete(); >- if (recFile.toString().endsWith(".rec")) >- { >- java.io.File recmodel = new java.io.File(javaFile.toString()+ "model"); >- recmodel.delete(); >- //also remove recmodel paired file >- } >- try { >- recFile.getParent().refreshLocal(1, new NullProgressMonitor()); >+ public static boolean deleteFile(IFile iFile){ >+ >+ boolean isSuccessful = false; >+ >+ if(iFile != null){ >+ >+ //Workspace file check: >+ if (iFile.exists()){ >+ >+ try { >+ >+ iFile.delete(true, new NullProgressMonitor()); >+ >+ isSuccessful = true; >+ } >+ catch (Exception e) { >+ //Ignore and return false; >+ } > } >- catch (Exception e) {} >- } >- if (tgFile != null) >- { >- java.io.File javaFile = new java.io.File(tgFile.getRawLocationURI()); >- javaFile.delete(); >- try { >- tgFile.getParent().refreshLocal(1, new NullProgressMonitor()); >+ >+ //File system file check: >+ else{ >+ >+ IPath iFilePath = iFile.getLocation(); >+ >+ if (iFilePath != null){ >+ >+ File file = iFilePath.toFile(); >+ >+ if(file.exists()){ >+ isSuccessful = file.delete(); >+ } >+ } > } >- catch (Exception e) {} > >+ if(isSuccessful){ >+ >+ //Attempt to refresh the file's container: >+ try { >+ iFile.getParent().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor()); >+ } >+ catch (Exception e) { >+ //Ignore since the file's container could not be refreshed. >+ } >+ } > } >- return true; >- } > >+ return isSuccessful; >+ } > } >Index: src/org/eclipse/hyades/test/core/internal/changes/CreateFileChange.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/hyades/test/core/internal/changes/CreateFileChange.java,v >retrieving revision 1.3 >diff -u -r1.3 CreateFileChange.java >--- src/org/eclipse/hyades/test/core/internal/changes/CreateFileChange.java 9 Apr 2008 11:03:22 -0000 1.3 >+++ src/org/eclipse/hyades/test/core/internal/changes/CreateFileChange.java 25 Mar 2010 15:59:10 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2008 IBM Corporation and others. >+ * Copyright (c) 2006, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -14,7 +14,6 @@ > import java.io.IOException; > import java.io.InputStream; > import java.io.UnsupportedEncodingException; >-import java.net.URI; > > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; >@@ -30,11 +29,14 @@ > import org.eclipse.osgi.util.NLS; > > /** >- * Change that creates a text file and fills it in with an initial content. >- * @author jcanches >- * @author jbozier >- * @since 4.3 >- * @version April 5, 2008 >+ * <p>Change that creates a text file with initial content.</p> >+ * >+ * >+ * @author Julien Canches >+ * @author Jerome Bozier >+ * @author Paul Slauenwhite >+ * @version March 25, 2010 >+ * @since August 29, 2006 > */ > public class CreateFileChange extends Change { > >@@ -111,13 +113,13 @@ > } > > public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { >+ > RefactoringStatus status = new RefactoringStatus(); > >- URI location = fFile.getLocationURI(); >- if (location == null) { >+ if (fFile.getLocation() == null) { > status.addFatalError(NLS.bind(ChangesMessages.UNKNOWN_LOCATION, fFile.getFullPath().toString())); >- return status; > } >+ > return status; > } > >Index: src/org/eclipse/hyades/test/core/testgen/util/TestGenFileUtil.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/hyades/test/core/testgen/util/TestGenFileUtil.java,v >retrieving revision 1.8 >diff -u -r1.8 TestGenFileUtil.java >--- src/org/eclipse/hyades/test/core/testgen/util/TestGenFileUtil.java 18 Nov 2009 18:48:29 -0000 1.8 >+++ src/org/eclipse/hyades/test/core/testgen/util/TestGenFileUtil.java 25 Mar 2010 15:59:10 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2009 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -34,13 +34,13 @@ > import org.eclipse.osgi.util.NLS; > > /** >- * File utility methods used by test generators. >+ * <p>Utilities for test generator files.</p> > * > * > * @author Ashish Mathur > * @author Paul E. Slauenwhite > * @author Jerome Bozier >- * @version November 17, 2009 >+ * @version March 25, 2010 > * @since June 8, 2005 > */ > public class TestGenFileUtil { >@@ -50,7 +50,6 @@ > * it will add ".rec" > * @param filepath > * @return >- * @deprecated > */ > public static IFile createTraceFile(String filepath) { > >@@ -73,8 +72,8 @@ > } > } > } >- catch (RuntimeException e) { >- e.printStackTrace(); >+ catch (Exception e) { >+ TestCorePlugin.getDefault().logError(e); > } > > return file; >Index: src/org/eclipse/tptp/test/internal/recorder/framework/RecorderDataProcessor.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/tptp/test/internal/recorder/framework/RecorderDataProcessor.java,v >retrieving revision 1.6 >diff -u -r1.6 RecorderDataProcessor.java >--- src/org/eclipse/tptp/test/internal/recorder/framework/RecorderDataProcessor.java 22 Mar 2007 14:42:34 -0000 1.6 >+++ src/org/eclipse/tptp/test/internal/recorder/framework/RecorderDataProcessor.java 25 Mar 2010 15:59:10 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -14,17 +14,21 @@ > import java.io.IOException; > > import org.eclipse.core.resources.IFile; >-import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.hyades.execution.recorder.IRecorderDataProcessor; > import org.eclipse.hyades.execution.recorder.RecorderFactory; >-import org.eclipse.hyades.internal.execution.recorder.utilities.RecorderFileUtil; > import org.eclipse.hyades.test.core.internal.resources.TestCorePluginResourceBundle; >+import org.eclipse.hyades.test.core.testgen.util.TestGenFileUtil; > import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderMessageProvider; > > /** >- * @author jnevicos >- * >+ * <p>RecorderDataProcessor.java</p> >+ * >+ * >+ * @author Jeffrey Nevicosi >+ * @author Paul Slauenwhite >+ * @version March 25, 2010 >+ * @since September 23, 2005 > */ > public class RecorderDataProcessor implements IRecorderDataProcessor { > >@@ -50,21 +54,16 @@ > String fileName = RecorderFactory.getInstance().getRecorderWithID(recorderID).getRecordingPath(); > if (fileName != null && fileName.length() > 0) > { >- try >- >- { >- if (provider == null) >- { //creation of the trace file is a requirement of the provider's init() method >+ if (provider == null){ >+ >+ //creation of the trace file is a requirement of the provider's init() method > //this is because one static method cannot be accountable for creation in any & all variations >- traceFile = RecorderFileUtil.createTraceFile(fileName); >- if (!traceFile.exists()) >- throw new IOException(TestCorePluginResourceBundle.RecorderDataProcessor_UNABLE_TO_CREATE_TRACE_FILE_ERROR); >+ traceFile = TestGenFileUtil.createTraceFile(fileName); >+ >+ if((traceFile == null) || (!traceFile.exists())){ >+ throw new IOException(TestCorePluginResourceBundle.RecorderDataProcessor_UNABLE_TO_CREATE_TRACE_FILE_ERROR + fileName); >+ } > } >- } >- catch (CoreException e) >- { >- throw new IOException(TestCorePluginResourceBundle.RecorderDataProcessor_UNABLE_TO_CREATE_TRACE_FILE_ERROR+e.getMessage()); >- } > } > if (provider != null) > provider.initialize(); >#P org.eclipse.hyades.test.ui >Index: src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java,v >retrieving revision 1.19 >diff -u -r1.19 NewTestFromRecordingWizard.java >--- src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java 4 Jul 2008 14:09:12 -0000 1.19 >+++ src-recorder/org/eclipse/tptp/test/internal/recorder/ui/wizards/NewTestFromRecordingWizard.java 25 Mar 2010 15:59:12 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -38,13 +38,12 @@ > import org.eclipse.tptp.test.provisional.recorder.ui.wizards.RecLocationWizardPage; > > /** >- * NewTestFromRecordingWizard.java. >- * <p/> >+ * <p>NewTestFromRecordingWizard.java.</p> > * > * > * @author Paul E. Slauenwhite > * @author Jeffery Nevicosi >- * @version July 4, 2008 >+ * @version March 25, 2010 > * @since September 23, 2005 > */ > public class NewTestFromRecordingWizard extends HyadesWizard implements IGenericRecorderWizard { >@@ -124,7 +123,7 @@ > UiPluginResourceBundle.DefaultRecWizardProvider_TESTSUITE_EXISTS); > if (!b) > return false; >- RecorderFileUtil.deleteFiles(null, tgFile); >+ RecorderFileUtil.deleteFile(tgFile); > > } > TestgenUIWrapper wrapper = new TestgenUIWrapper(getRecorderData(IRecorderPageProvider.WIZARD_KEY_TESTGEN_ID), >Index: src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/DefaultRecWizardProvider.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/DefaultRecWizardProvider.java,v >retrieving revision 1.9 >diff -u -r1.9 DefaultRecWizardProvider.java >--- src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/DefaultRecWizardProvider.java 22 Mar 2007 14:42:14 -0000 1.9 >+++ src-recorder/org/eclipse/tptp/test/provisional/recorder/ui/wizards/DefaultRecWizardProvider.java 25 Mar 2010 15:59:12 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -23,14 +23,18 @@ > import org.eclipse.jface.dialogs.MessageDialog; > > /** >- * A default implementation of IRecorderPageProvider. >+ * <p>Default recording wizard provider that provides an additional page ({@link TestsuiteLocationWizardPage}) >+ * to enter the path/name of the test suite, which is used to derive the recording and recording model file >+ * paths/names.</p> > * >- * This provides 1 additonal page: TestsuiteLocationWizardPage >- * This provides data for the testsuite path & the recording path (which is >- * derived from the user-input testsuite path) >- * @author jnevicos >- * @see IGenericRecorderPage >- * @see NewTestFromRecordingWizard >+ * >+ * @author Jeffrey Nevicosi >+ * @author Paul Slauenwhite >+ * @version March 25, 2010 >+ * @since February 1, 2006 >+ * @see IRecorderPageProvider >+ * @see TestsuiteLocationWizardPage >+ * @see IGenericRecorderPage > */ > public class DefaultRecWizardProvider implements IRecorderPageProvider { > >@@ -89,8 +93,9 @@ > UiPluginResourceBundle.DefaultRecWizardProvider_BOTH_EXIST); > if (!b) > return false; >- //on win32, predelete the non-case-sensitive file >- RecorderFileUtil.deleteFiles(recFile, tgFile); >+ >+ RecorderFileUtil.deleteRecordingFile(recFile); >+ RecorderFileUtil.deleteFile(tgFile); > > } > else if (bRecExists) >@@ -99,7 +104,7 @@ > UiPluginResourceBundle.DefaultRecWizardProvider_REC_EXISTS); > if (!b) > return false; >- RecorderFileUtil.deleteFiles(recFile, null); >+ RecorderFileUtil.deleteRecordingFile(recFile); > > } > else if (bTestExists) >@@ -108,7 +113,7 @@ > UiPluginResourceBundle.DefaultRecWizardProvider_TESTSUITE_EXISTS); > if (!b) > return false; >- RecorderFileUtil.deleteFiles(null, tgFile); >+ RecorderFileUtil.deleteFile(tgFile); > } > > String parms = wizard.getRecorderData(WIZARD_KEY_CONFIG_PARAMS); >Index: src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/RunTestGenWizard.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/RunTestGenWizard.java,v >retrieving revision 1.16 >diff -u -r1.16 RunTestGenWizard.java >--- src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/RunTestGenWizard.java 13 Aug 2009 17:29:09 -0000 1.16 >+++ src-testgen/org/eclipse/hyades/internal/execution/testgen/ui/wizards/RunTestGenWizard.java 25 Mar 2010 15:59:12 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2009 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -30,13 +30,13 @@ > import org.eclipse.ui.INewWizard; > > /** >- * <p>Wizard which prompts the user for the test generator to use with test generation and also prompts for the location of the generated >- * test suite.</p> >+ * <p>Wizard which prompts the user for the test generator to use with test >+ * generation and also prompts for the location of the generated test suite.</p> > * > * > * @author Ernest Jessee > * @author Paul E. Slauenwhite >- * @version August 13, 2009 >+ * @version March 25, 2010 > * @since February 1, 2005 > */ > public class RunTestGenWizard extends HyadesNewWizard >@@ -92,7 +92,7 @@ > ); > if (!b) > return b; >- RecorderFileUtil.deleteFiles(null, file); >+ RecorderFileUtil.deleteFile(file); > } > > TestgenUIWrapper wrapper = new TestgenUIWrapper(generatorID, selectedRecModelFile, testFileSelectionPage.getSelectedFilePath()); >#P org.eclipse.tptp.test.recorders.url >Index: src/org/eclipse/tptp/test/recorders/url/internal/local/URLRecorderDataProcessor.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.recorders.url/src/org/eclipse/tptp/test/recorders/url/internal/local/URLRecorderDataProcessor.java,v >retrieving revision 1.1 >diff -u -r1.1 URLRecorderDataProcessor.java >--- src/org/eclipse/tptp/test/recorders/url/internal/local/URLRecorderDataProcessor.java 11 Mar 2008 18:18:46 -0000 1.1 >+++ src/org/eclipse/tptp/test/recorders/url/internal/local/URLRecorderDataProcessor.java 25 Mar 2010 15:59:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2008 IBM Corporation and others. >+ * Copyright (c) 2008, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -15,10 +15,9 @@ > import java.io.IOException; > > import org.eclipse.core.resources.IFile; >-import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.hyades.execution.recorder.IRecorderDataProcessor; >-import org.eclipse.hyades.internal.execution.recorder.utilities.RecorderFileUtil; >+import org.eclipse.hyades.test.core.testgen.util.TestGenFileUtil; > import org.eclipse.tptp.test.provisional.recorder.framework.IRecorderMessageProvider; > import org.eclipse.tptp.test.provisional.recorder.messages.AbstractRecorderMessageProvider; > import org.eclipse.tptp.test.recorders.url.internal.URLRecorderActivator; >@@ -34,7 +33,7 @@ > * > * @author Paul E. Slauenwhite > * @author Ernest Jessee >- * @version March 11, 2008 >+ * @version March 25, 2010 > * @since March 11, 2008 > */ > public class URLRecorderDataProcessor extends AbstractRecorderMessageProvider >@@ -58,22 +57,20 @@ > public void initialize() throws IOException > { > String fileName = URLRecorderActivator.getPreference(URLRecorderConstants.RECORDING_PATH); >- if (getRecorder() != null) >+ >+ if (getRecorder() != null){ > fileName = getRecorder().getRecordingPath(); >- try >- { >- traceFile = RecorderFileUtil.createTraceFile(fileName); >- javaTraceFile = traceFile.getRawLocation().toFile(); >- if (!javaTraceFile.exists()) >- { throw new IOException(URLRecorderResourceBundle.URLRecorderDataProcessor_UNABLE_TO_CREATE_TRACE_FILE_ERROR); >- } > } >- catch (CoreException e) >- { >- throw new IOException(URLRecorderResourceBundle.URLRecorderDataProcessor_UNABLE_TO_CREATE_TRACE_FILE_ERROR+e.getMessage()); >- } > >- RecorderFileUtil.createTraceModel(fileName, traceFile.getFullPath().toString()); >+ traceFile = TestGenFileUtil.createTraceFile(fileName); >+ >+ if((traceFile == null) || (!traceFile.exists())){ >+ throw new IOException(URLRecorderResourceBundle.URLRecorderDataProcessor_UNABLE_TO_CREATE_TRACE_FILE_ERROR + fileName); >+ } >+ >+ javaTraceFile = traceFile.getRawLocation().toFile(); >+ >+ TestGenFileUtil.createTraceModel(fileName, traceFile.getFullPath().toString()); > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 307033
: 163008