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 36052 Details for
Bug 106990
[connector] CollabNet IssueZilla/IssueTracker
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]
collab support
patch-sandbox.tests.txt (text/plain), 12.54 KB, created by
Marco
on 2006-03-10 07:52:11 EST
(
hide
)
Description:
collab support
Filename:
MIME Type:
Creator:
Marco
Created:
2006-03-10 07:52:11 EST
Size:
12.54 KB
patch
obsolete
>Index: CollabNetRegularExpressionTest.java >=================================================================== >RCS file: /home/technology/org.eclipse.mylar/org.eclipse.mylar.sandbox/testsrc/org/eclipse/mylar/sandbox/tests/CollabNetRegularExpressionTest.java,v >retrieving revision 1.2 >diff -u -r1.2 CollabNetRegularExpressionTest.java >--- CollabNetRegularExpressionTest.java 7 Feb 2006 03:32:38 -0000 1.2 >+++ CollabNetRegularExpressionTest.java 10 Mar 2006 12:53:55 -0000 >@@ -54,7 +54,7 @@ > private static final RegularExpression reColVal7 = new RegularExpression("<span class=\"summary\">([^>]+)</span>", > "i"); > >- public void testMatchV220() throws IOException { >+ public void testMatchCollabNetV1() throws IOException { > BufferedReader in = new BufferedReader(new StringReader(EXAMPLE_REPORT)); > Match match = new Match(); > BugzillaSearchHit hit = createHit(new NullProgressMonitor(), in, match, >@@ -138,6 +138,7 @@ > public static String readSeverity(String line) { > Match match = new Match(); > if (reColVal1.matches(line, match)) { >+ assertEquals("nor", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >@@ -147,6 +148,7 @@ > public static String readPriority(String line) { > Match match = new Match(); > if (reColVal2.matches(line, match)) { >+ assertEquals("priority", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >@@ -156,6 +158,7 @@ > public static String readPlatform(String line) { > Match match = new Match(); > if (reColVal3.matches(line, match)) { >+ assertEquals("platform", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >@@ -165,6 +168,7 @@ > public static String readOwner(String line) { > Match match = new Match(); > if (reColVal4.matches(line, match)) { >+ assertEquals("owner", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >@@ -174,6 +178,7 @@ > public static String readStatus(String line) { > Match match = new Match(); > if (reColVal5.matches(line, match)) { >+ assertEquals("status", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >@@ -183,6 +188,7 @@ > public static String readResolution(String line) { > Match match = new Match(); > if (reColVal6.matches(line, match)) { >+ assertEquals("resolution", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >@@ -192,6 +198,7 @@ > public static String readSummary(String line) { > Match match = new Match(); > if (reColVal7.matches(line, match)) { >+ assertEquals("summary", match.getCapturedText(1)); > return match.getCapturedText(1); > } else { > return "none"; >Index: SharedTaskFolderTest.java >=================================================================== >RCS file: SharedTaskFolderTest.java >diff -N SharedTaskFolderTest.java >--- SharedTaskFolderTest.java 25 Jan 2006 20:54:04 -0000 1.5 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,210 +0,0 @@ >-package org.eclipse.mylar.sandbox.tests; >- >-import java.io.File; >-import java.io.FileInputStream; >-import java.io.FileOutputStream; >-import java.io.IOException; >-import java.io.InputStream; >-import java.io.OutputStream; >- >-import junit.framework.TestCase; >- >-import org.eclipse.mylar.core.InteractionEvent; >-import org.eclipse.mylar.core.MylarPlugin; >-import org.eclipse.mylar.internal.core.MylarContext; >-import org.eclipse.mylar.internal.monitor.reports.MylarReportsPlugin; >-import org.eclipse.mylar.internal.sandbox.MylarSandboxPlugin; >-import org.eclipse.mylar.internal.sandbox.share.SwitchTaskDataFolderAction; >-import org.eclipse.mylar.internal.tasklist.ITask; >-import org.eclipse.mylar.internal.tasklist.MylarTaskListPlugin; >-import org.eclipse.mylar.internal.tasklist.Task; >-import org.eclipse.mylar.internal.tasklist.TaskListManager; >- >-/** >- * Tests changing the shared task directory >- * currently in use. >- * >- * @author Wesley Coelho >- */ >-public class SharedTaskFolderTest extends TestCase{ >- >- private File sharedDataRootDir = null; >- private File bobsDataDir = null; >- private File jillsDataDir = null; >- private String originalMainDataDir = null; >- private String originalSharedDataDir = null; >- private TaskListManager manager = MylarTaskListPlugin.getTaskListManager(); >- >- /** >- * Set up a shared task directory structure by creating some data >- * in the main directory and copying it to the shared directories. >- */ >- protected void setUp() throws Exception { >- super.setUp(); >- >- //Get the original main data directory so that it can be reset later >- originalMainDataDir = MylarPlugin.getDefault().getDataDirectory(); >- >- //Create a task to make sure there is some data in the main directory >- createAndSaveTask("Task1"); >- >- //Create the shared data directory structure >- sharedDataRootDir = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + "SharedDataDir"); >- sharedDataRootDir.mkdir(); >- assertTrue(sharedDataRootDir.exists()); >- >- bobsDataDir = new File(sharedDataRootDir.getPath() + File.separator + "Bob"); >- bobsDataDir.mkdir(); >- assertTrue(bobsDataDir.exists()); >- >- jillsDataDir = new File(sharedDataRootDir.getPath() + File.separator + "Jill"); >- jillsDataDir.mkdir(); >- assertTrue(jillsDataDir.exists()); >- >- //Start the shared data dirs off with copies of the main data >- File mainDataDir = new File(originalMainDataDir); >- for ( File currFile : mainDataDir.listFiles()) { >- File destFile = new File(bobsDataDir.getPath() + File.separator + currFile.getName()); >- copy(currFile, destFile); >- destFile = new File(jillsDataDir.getPath() + File.separator + currFile.getName()); >- copy(currFile, destFile); >- } >- >- //Set the shared data dir >- originalSharedDataDir = MylarSandboxPlugin.getDefault().getSharedDataDirectoryManager().getSharedDataDirectory(); >- MylarReportsPlugin.getDefault().getPreferenceStore().setValue(MylarReportsPlugin.SHARED_TASK_DATA_ROOT_DIR, sharedDataRootDir.getPath()); >- MylarSandboxPlugin.getDefault().getSharedDataDirectoryManager().setSharedDataDirectory(sharedDataRootDir.getPath()); >- assertFalse(MylarPlugin.getDefault().getDataDirectory().equals(sharedDataRootDir.getPath())); >- } >- >- /** >- * Tests moving the main mylar data directory to another location >- */ >- public void testSharedDataDirSwitching(){ >- SwitchTaskDataFolderAction switchAction = new SwitchTaskDataFolderAction(); >- >- //Create a task to appear in the main data dir only >- ITask mainDataDirTask = createAndSaveTask("Main Dir Task"); >- >- //Check the options of folders to switch to >- String[] sharedDataFolderOptions = switchAction.getFolderStrings(); >- //Note that index 0 is a string indicating a switch back to the main data directory >- assertTrue(sharedDataFolderOptions[0].equals("Bob")); >- assertTrue(sharedDataFolderOptions[1].equals("Jill")); >- >- //Switch to Bob's folder >- switchAction.switchTaskDataFolder(sharedDataFolderOptions[0]); >- >- //Check that the task created in the main data dir isn't there >- File mainDataDirTaskFile = MylarPlugin.getContextManager().getFileForContext(mainDataDirTask.getHandleIdentifier()); >-// File mainDataDirTaskFile = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + mainDataDirTask.getContextPath() + MylarTaskListPlugin.FILE_EXTENSION); >- assertFalse(mainDataDirTaskFile.exists()); >- assertNull(manager.getTaskForHandle(mainDataDirTask.getHandleIdentifier(), false)); >- >- fail(); // uncomment below >- //Create a new task in bob's task data folder only and check that it exists in the right place >-// ITask bobsTask = createAndSaveTask("Bob's Task"); >-// >-// File bobsTaskFile = new File(bobsDataDir.getPath() + File.separator + >-// MylarPlugin.getContextManager().getFileForContext(mainDataDirTask.getHandleIdentifier()).getName()); >-// assertTrue(bobsTaskFile.exists()); >-// bobsTaskFile = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + bobsTask.getContextPath() + MylarTaskListPlugin.FILE_EXTENSION); >-// assertTrue(bobsTaskFile.exists()); >-// assertNotNull(manager.getTaskForHandle(bobsTask.getHandleIdentifier(), false)); >-// >-// //Switch to Jill's folder >-// switchAction.switchTaskDataFolder(sharedDataFolderOptions[1]); >-// >-// //Check that Bob's task isn't there >-// bobsTaskFile = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + bobsTask.getContextPath() + MylarTaskListPlugin.FILE_EXTENSION); >-// assertFalse(bobsTaskFile.exists()); >-// assertNull(manager.getTaskForHandle(bobsTask.getHandleIdentifier(), false)); >-// >-// //Switch back to Bob's folder >-// switchAction.switchTaskDataFolder(sharedDataFolderOptions[0]); >-// >-// //Check that bob's task is still there >-// bobsTaskFile = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + bobsTask.getContextPath() + MylarTaskListPlugin.FILE_EXTENSION); >-// assertTrue(bobsTaskFile.exists()); >-// assertNotNull(manager.getTaskForHandle(bobsTask.getHandleIdentifier(), false)); >-// >-// //Switch back to the main data folder >-// sharedDataFolderOptions = switchAction.getFolderStrings(); >-// switchAction.switchTaskDataFolder(sharedDataFolderOptions[0]); >-// >-// //Check that the main task is there >-// mainDataDirTaskFile = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + mainDataDirTask.getContextPath() + MylarTaskListPlugin.FILE_EXTENSION); >-// assertTrue(mainDataDirTaskFile.exists()); >-// assertNotNull(manager.getTaskForHandle(mainDataDirTask.getHandleIdentifier(), false)); >- >- } >- >- /** >- * Creates a task with an interaction event and checks that it has >- * been properly saved in the currently active data directory >- */ >- protected ITask createAndSaveTask(String taskName){ >- >- //Create the task and add it to the root of the task list >- ITask newTask = new Task(MylarTaskListPlugin.getTaskListManager().genUniqueTaskHandle(), taskName, true); >- manager.moveToRoot(newTask); >- MylarContext mockContext = MylarPlugin.getContextManager().loadContext(newTask.getHandleIdentifier());//, newTask.getContextPath()); >- InteractionEvent event = new InteractionEvent(InteractionEvent.Kind.EDIT,"structureKind","handle","originId"); >- mockContext.parseEvent(event); >- MylarPlugin.getContextManager().contextActivated(mockContext); >- >- fail(); // uncomment below >-// //Save the context file and check that it exists >-// MylarPlugin.getContextManager().saveContext(mockContext.getId());//, newTask.getContextPath()); >-// File taskFile = new File(MylarPlugin.getDefault().getDataDirectory() + File.separator + newTask.getContextPath() + MylarContextManager.CONTEXT_FILE_EXTENSION); >-// assertTrue(MylarPlugin.getContextManager().hasContext(newTask.getContextPath())); >-// assertTrue(taskFile.exists()); >- >- return newTask; >- } >- >- protected void tearDown() throws Exception{ >- >- //Reset the shared directory to the original value >- MylarSandboxPlugin.getDefault().getSharedDataDirectoryManager().setSharedDataDirectory(originalSharedDataDir); >- MylarReportsPlugin.getDefault().getPreferenceStore().setValue(MylarReportsPlugin.SHARED_TASK_DATA_ROOT_DIR, originalSharedDataDir); >- >- //Delete the test shared data directories >- deleteDir(bobsDataDir); >- deleteDir(jillsDataDir); >- deleteDir(sharedDataRootDir); >- >- super.tearDown(); >- } >- >- private void deleteDir(File targetDir){ >- File[] files = targetDir.listFiles(); >- for (File file : files) { >- file.delete(); >- } >- >- targetDir.delete(); >- assertFalse(targetDir.exists()); >- } >- >- // Note: Copied from MylarTaskListPlugin >- private boolean copy(File src, File dst) { >- try { >- InputStream in = new FileInputStream(src); >- OutputStream out = new FileOutputStream(dst); >- >- // Transfer bytes from in to out >- byte[] buf = new byte[1024]; >- int len; >- while ((len = in.read(buf)) > 0) { >- out.write(buf, 0, len); >- } >- in.close(); >- out.close(); >- return true; >- } catch (IOException ioe) { >- return false; >- } >- } >- >-} >Index: .project >=================================================================== >RCS file: .project >diff -N .project >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .project 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,11 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<projectDescription> >+ <name>tests</name> >+ <comment></comment> >+ <projects> >+ </projects> >+ <buildSpec> >+ </buildSpec> >+ <natures> >+ </natures> >+</projectDescription>
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 106990
:
31935
|
33757
|
34145
|
34502
|
35718
|
36052
|
36551