TestPathComparison.java from Kneobase at Krugle
Show TestPathComparison.java syntax highlighted
package com.kneobase.driver.ftp;
import junit.framework.TestCase;
/**
* @author patricio.keilty@colaborativa.net
*
*/
public class TestPathComparison extends TestCase {
private String referencePath = "/1/2/3/";
private String noMatch = "/0/1/";
private String isInPath = "/1/2";
private String exactMatch = "/1/2/3";
private String longerThatMatches = "/1/2/3/4/5";
private String trickyPath = "/1/2/34";
private String refMatchesAll = "/";
private FtpContentSource source;
/**
* Constructor for TestPathComparison.
* @param arg0
*/
public TestPathComparison(String arg0) {
super(arg0);
}
/**
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
source = new FtpContentSource( "my_test" );
}
/**
* @see TestCase#tearDown()
*/
protected void tearDown() throws Exception {
super.tearDown();
}
/*
public void testIsInPath(){
assertTrue( 0 == source.doPathsMatch( this.isInPath, this.referencePath ) );
assertTrue( source.doPathsMatch( this.refMatchesAll, this.referencePath ) == 0 );
assertTrue( source.doPathsMatch( this.isInPath, this.refMatchesAll ) >= 0 );
}
public void testExactMatch(){
assertTrue( 1 == source.doPathsMatch( this.exactMatch, this.referencePath ));
assertTrue( source.doPathsMatch( this.exactMatch, this.refMatchesAll ) >= 0 );
}
public void testNoMatch(){
assertTrue( -1 == source.doPathsMatch( this.noMatch, this.referencePath ));
assertTrue( source.doPathsMatch( this.noMatch, this.refMatchesAll ) >= 0 );
}
public void testTrickyPath(){
assertTrue( -1 == source.doPathsMatch( this.trickyPath, this.referencePath ));
assertTrue( source.doPathsMatch( this.trickyPath, this.refMatchesAll ) >= 0 );
}
public void testLongerThatMatches(){
assertTrue( 1 == source.doPathsMatch( this.longerThatMatches, this.referencePath ));
assertTrue( source.doPathsMatch( this.longerThatMatches, this.refMatchesAll ) >= 0 );
}
*/
}
See more files for this project here