org.tigris.subversion.svnclientadapter.SVNNodeKind Java Examples

The following examples show how to use org.tigris.subversion.svnclientadapter.SVNNodeKind. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileConflict() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-conflicts/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.CONFLICTED, parsedStatus.getTextStatus());
    assertEquals(5, parsedStatus.getRevision().getNumber());
    assertEquals(5, parsedStatus.getLastChangedRevision().getNumber());
    assertNotNull(parsedStatus.getConflictNew());
    assertNotNull(parsedStatus.getConflictOld());
    assertNotNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T04:12:27.726955Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(5, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #2
Source File: CreateFolderAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public boolean isEnabled() {
    Browser browser = getBrowser();
    if(browser == null) {
        return false;
    }        
    if(browser.getExplorerManager().getRootContext() == Node.EMPTY) {
        return false;
    }
    Node[] nodes = getBrowser().getSelectedNodes();
    if(nodes.length != 1) {
        return false;
    }
    return nodes[0] instanceof RepositoryPathNode && 
           ((RepositoryPathNode) nodes[0]).getEntry().getSvnNodeKind() == SVNNodeKind.DIR;
}
 
Example #3
Source File: SVNFolderCompareEditorInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private SVNDiffSummary[] getDiffSummaryWithSubfolders(SVNDiffSummary[] diffSummary) {
	ArrayList paths = new ArrayList();
	ArrayList diffs = new ArrayList();
	for (int i = 0; i < diffSummary.length; i++) {
		paths.add(diffSummary[i].getPath());
		diffs.add(diffSummary[i]);
	}
	for (int i = 0; i < diffSummary.length; i++) {
		File file = new File(diffSummary[i].getPath());
		while (file.getParentFile() != null) {
			file = file.getParentFile();
			String path = file.getPath();
			path = path.replaceAll("\\\\", "/");
			if (!paths.contains(path)) {
				paths.add(path);
				SVNDiffSummary folder = new SVNDiffSummary(path, SVNDiffKind.NORMAL, false, SVNNodeKind.DIR.toInt());
				diffs.add(folder);
			}
		}
	}
	diffSummary = new SVNDiffSummary[diffs.size()];
	diffs.toArray(diffSummary);
	return diffSummary;
}
 
Example #4
Source File: OperationManager.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void onNotify(File path, SVNNodeKind kind) {
	IPath pathEclipse = new Path(path.getAbsolutePath());
	IResource[] resources = SVNWorkspaceRoot.getResourcesFor(pathEclipse, false);
	for (IResource resource : resources) {			
		localRefreshList.add(resource);
	}
       
	if (operationNotifyListener != null)
	{
		operationNotifyListener.onNotify(path, kind);
		if ((operationNotifyListener.getMonitor() != null) && (operationNotifyListener.getMonitor().isCanceled()))
		{
			try {
				svnClient.cancelOperation();
			} catch (SVNClientException e) {
				SVNProviderPlugin.log(SVNException.wrapException(e));
			}
		}
	}
}
 
Example #5
Source File: SVNLocalCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private SVNDiffSummary[] getDiffSummaryWithSubfolders(SVNDiffSummary[] diffSummary) {
	ArrayList paths = new ArrayList();
	ArrayList diffs = new ArrayList();
	for (int i = 0; i < diffSummary.length; i++) {
		paths.add(diffSummary[i].getPath());
		diffs.add(diffSummary[i]);
	}
	for (int i = 0; i < diffSummary.length; i++) {
		File file = new File(diffSummary[i].getPath());
		while (file.getParentFile() != null) {
			file = file.getParentFile();
			String path = file.getPath();
			path = path.replaceAll("\\\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
			if (!paths.contains(path)) {
				paths.add(path);
				SVNDiffSummary folder = new SVNDiffSummary(path, SVNDiffKind.NORMAL, false, SVNNodeKind.DIR.toInt());
				diffs.add(folder);
			}
		}
	}
	diffSummary = new SVNDiffSummary[diffs.size()];
	diffs.toArray(diffSummary);
	return diffSummary;
}
 
Example #6
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusNoChanges() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/no-changes/testapp/Main.java");
    assertTrue(myFile.exists());
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/Main.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(2, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-12T10:43:46.371180Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(2, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #7
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusNoChangesNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-no-changes/testapp/Main.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/Main.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(16, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-08-05T03:42:58.306031Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(16, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #8
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileChanges() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-changes/testapp/Main.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/Main.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.MODIFIED, parsedStatus.getTextStatus());
    assertEquals(2, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-12T10:43:46.371180Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(2, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #9
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileChangesNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-changes/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.MODIFIED, parsedStatus.getTextStatus());
    assertEquals(16, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T07:05:57.738276Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(10, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #10
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileUnknown() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-unknown/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getTextStatus());
    assertEquals(0, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(0, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.UNKNOWN, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #11
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileUnknownNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-unknown/testapp/readme.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/readme.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getTextStatus());
    assertEquals(0, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(0, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.UNKNOWN, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #12
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Tests a specific case... where the file doesn't exist, and there is no entry in the SVN
 * files, but it's still being queried by the module.  Return unversioned
 */
public void testGetSingleStatusFileUnknownAnywhere() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/no-changes/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getTextStatus());
    assertEquals(0, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(0, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.UNKNOWN, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #13
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Tests a specific case... where the file doesn't exist, and there is no entry in the SVN
 * files, but it's still being queried by the module.  Return unversioned.  Working copy is
 * the format as of SVN 1.4.0
 */
public void testGetSingleStatusFileUnknownAnywhereNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-no-changes/testapp/readme.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/readme.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getTextStatus());
    assertEquals(0, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(0, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.UNKNOWN, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.UNVERSIONED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #14
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileAdded() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-added/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.ADDED, parsedStatus.getTextStatus());
    assertEquals(0, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(-1, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #15
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileAddedNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-added/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.ADDED, parsedStatus.getTextStatus());
    assertEquals(0, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(-1, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #16
Source File: SwitchToAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private boolean validateInput(File root, RepositoryFile toRepositoryFile) {
    boolean ret = false;
    SvnClient client;
    try {                   
        client = Subversion.getInstance().getClient(toRepositoryFile.getRepositoryUrl());
        ISVNInfo info = client.getInfo(toRepositoryFile.getFileUrl());
        if(info.getNodeKind() == SVNNodeKind.DIR && root.isFile()) {
            SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFileToFolderError"));
            ret = false;
        } else if(info.getNodeKind() == SVNNodeKind.FILE && root.isDirectory()) {
            SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFolderToFileError"));
            ret = false;
        } else {
            ret = true;
        }
    } catch (SVNClientException ex) {
        SvnClientExceptionHandler.notifyException(ex, true, true);
        return ret;
    }                            
    return ret;
}
 
Example #17
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileConflictNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-conflicts/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.CONFLICTED, parsedStatus.getTextStatus());
    assertEquals(18, parsedStatus.getRevision().getNumber());
    assertEquals(18, parsedStatus.getLastChangedRevision().getNumber());
    assertNotNull(parsedStatus.getConflictNew());
    assertNotNull(parsedStatus.getConflictOld());
    assertNotNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-08-16T05:15:12.039161Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(18, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #18
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileRemoved() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-removed/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.DELETED, parsedStatus.getTextStatus());
    assertEquals(6, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T04:22:27.194329Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(6, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #19
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileRemovedNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-removed/testapp/ReadMe.txt");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/ReadMe.txt", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.DELETED, parsedStatus.getTextStatus());
    assertEquals(18, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-08-16T05:15:12.039161Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(18, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #20
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileCopied1() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-copied1/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertTrue(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.ADDED, parsedStatus.getTextStatus());
    assertEquals(5, parsedStatus.getRevision().getNumber());        
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(-1, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #21
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileCopied1NewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-copied1/testapp/AnotherAnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertTrue(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherAnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.ADDED, parsedStatus.getTextStatus());
    assertEquals(18, parsedStatus.getRevision().getNumber());        
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(-1, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #22
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileCopied2() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-copied2/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertTrue(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.ADDED, parsedStatus.getTextStatus());
    assertEquals(5, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(-1, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #23
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileCopied2NewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-copied2/testapp/AnotherAnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertTrue(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherAnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.ADDED, parsedStatus.getTextStatus());
    assertEquals(18, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    assertNull(parsedStatus.getLastChangedDate());
    assertEquals(-1, parsedStatus.getLastChangedRevision().getNumber());
    assertNull(parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NONE, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #24
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusPropertyAddedNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-prop-added/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(19, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T07:05:57.738276Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(10, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.MODIFIED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #25
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusPropertyModified() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/prop-modified/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(9, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T07:01:25.704780Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(9, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.MODIFIED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #26
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusPropertyModifiedNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-prop-modified/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(19, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T07:05:57.738276Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(10, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.MODIFIED, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}
 
Example #27
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileLocked() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/file-locked/testapp/Main.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/Main.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(10, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-12T10:43:46.371180Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(2, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertEquals("", parsedStatus.getLockComment());
    assertEquals("ed", parsedStatus.getLockOwner());
    expectedDate = SvnWcUtils.parseSvnDate("2006-05-27T04:15:00.168100Z");
    assertEquals(expectedDate, parsedStatus.getLockCreationDate());
}
 
Example #28
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileLockedNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-locked/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(19, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T07:05:57.738276Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(10, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertEquals("ed", parsedStatus.getLockOwner());
    expectedDate = SvnWcUtils.parseSvnDate("2006-08-29T10:28:18.570376Z");
    assertEquals(expectedDate, parsedStatus.getLockCreationDate());
}
 
Example #29
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusFileLockedWithCommentNewFormat() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/new-format-file-locked-with-comment/testapp/AnotherMain.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("svn://gonzo/testRepos/trunk/testApp/src/testapp/AnotherMain.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(19, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2006-04-25T07:05:57.738276Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(10, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("ed", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertEquals("This is my comment", parsedStatus.getLockComment());
    assertEquals("ed", parsedStatus.getLockOwner());
    expectedDate = SvnWcUtils.parseSvnDate("2006-08-29T10:36:02.498983Z");
    assertEquals(expectedDate, parsedStatus.getLockCreationDate());
}
 
Example #30
Source File: SvnWcParserTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetSingleStatusNoChangesKeywords() throws Exception {
    File myFile = new File(dataRootDir + "/SvnWcParser/no-changes-keywords/testapp/Main.java");
    ISVNStatus parsedStatus = svnWcParser.getSingleStatus(myFile);
    assertFalse(parsedStatus.isCopied());
    assertEquals("file:///data/subversion/trunk/testapp/Main.java", parsedStatus.getUrl().toString());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getTextStatus());
    assertEquals(989, parsedStatus.getRevision().getNumber());
    assertNull(parsedStatus.getConflictNew());
    assertNull(parsedStatus.getConflictOld());
    assertNull(parsedStatus.getConflictWorking());
    assertEquals(myFile, parsedStatus.getFile());
    Date expectedDate = SvnWcUtils.parseSvnDate("2007-06-13T12:02:16.625421Z");
    assertEquals(expectedDate, parsedStatus.getLastChangedDate());
    assertEquals(330, parsedStatus.getLastChangedRevision().getNumber());
    assertEquals("tomas", parsedStatus.getLastCommitAuthor());
    assertEquals(SVNNodeKind.FILE, parsedStatus.getNodeKind());
    assertEquals(myFile.getPath(), parsedStatus.getPath());
    assertEquals(SVNStatusKind.NORMAL, parsedStatus.getPropStatus());
    assertNull(parsedStatus.getLockComment());
    assertNull(parsedStatus.getLockOwner());
    assertNull(parsedStatus.getLockCreationDate());
}