Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > subclipse commit: rev 360 - in trunk/svnClientAdapter/src: main/org/tigris/subversion/svnclientadapter testcases/org/tigris/subversion/svnclientadapter

subclipse
Discussion topic

Back to topic list

subclipse commit: rev 360 - in trunk/svnClientAdapter/src: main/org/tigris/subversion/svnclientadapter testcases/org/tigris/subversion/svnclientadapter

Author cchab
Full name chabanois cédric
Date 2003-12-26 08:49:41 PST
Message Author: cchab
Date: Fri Dec 26 10:49:37 2003
New Revision: 360

Modified:
   trunk/svnClientAdapt​er/src/main/org/tigr​is/subversion/svncli​entadapter/SVNUrl.ja​va
   trunk/svnClientAdapt​er/src/testcases/org​/tigris/subversion/s​vnclientadapter/SVNU​rlTest.java
Log:
* SVNUrl.java
added getFile() to SVNUrl
* SVNUrlTest.java
test for getFile()

Modified: trunk/svnClientAdapt​er/src/main/org/tigr​is/subversion/svncli​entadapter/SVNUrl.ja​va
====================​====================​====================​==================
--- trunk/svnClientAdapt​er/src/main/org/tigr​is/subversion/svncli​entadapter/SVNUrl.ja​va (original)
+++ trunk/svnClientAdapt​er/src/main/org/tigr​is/subversion/svncli​entadapter/SVNUrl.ja​va Fri Dec 26 10:49:37 2003
@@ -113,4 +113,12 @@
     public String toString() {
         return get();
     }
+
+ /**
+ * @return the name of the file in the url
+ */
+ public String getFile() {
+ int i = svnUrl.lastIndexOf('/');
+ return svnUrl.substring(i+1);
+ }
 }

Modified: trunk/svnClientAdapt​er/src/testcases/org​/tigris/subversion/s​vnclientadapter/SVNU​rlTest.java
====================​====================​====================​==================
--- trunk/svnClientAdapt​er/src/testcases/org​/tigris/subversion/s​vnclientadapter/SVNU​rlTest.java (original)
+++ trunk/svnClientAdapt​er/src/testcases/org​/tigris/subversion/s​vnclientadapter/SVNU​rlTest.java Fri Dec 26 10:49:37 2003
@@ -5,6 +5,11 @@
 import junit.framework.TestCase;
 
 import org.tigris.subversio​n.svnclientadapter.S​VNUrl;
+
+/**
+ * This class tests SVNUrl
+ * Note that tests for SVNClientAdapter itself are in svnant
+ */
 public class SVNUrlTest extends TestCase
 {
 
@@ -30,5 +35,11 @@
        SVNUrl https = new SVNUrl("HTTPS://svn.​collab.net/repos/sub​clipse/");
        SVNUrl http = new SVNUrl("HTTP://svn.c​ollab.net/repos/subc​lipse/");
     }
-
+
+ public void testGetFile() throws Exception {
+ SVNUrl url1 = new SVNUrl("http://svn.collab.ne​t/repos/subclipse/my​file.txt");
+ assertEquals("myfile​.txt",url1.getFile()​);
+ SVNUrl url2 = new SVNUrl("http://svn.collab.ne​t/repos/subclipse/");
+ assertEquals("",url2​.getFile());
+ }
 }

--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@subc​lipse.tigris.org
For additional commands, e-mail: cvs-help at subclipse dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

subclipse commit: rev 360 - in trunk/svnClientAdapter/src: main/org/tigris/subversion/svnclientadapter testcases/org/tigris/subversion/svnclientadapter cchab chabanois cédric 2003-12-26 08:49:41 PST
Messages per page: