/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* JUnit test to test that the DirectoryListing produce the expected result
*/
public class DirectoryListingTest {
FileEntry() {
}
this.lastModified = lastModified;
}
}
long val = lastModified;
}
assertTrue("Failed to set modification time",
if (size > 0) {
}
}
long lastModified;
int size;
if (o instanceof FileEntry) {
// @todo verify all attributes!
}
return -1;
}
}
public DirectoryListingTest() {
}
}
}
}
}
}
}
if (f.isDirectory()) {
removeDirectory(f);
}
f.delete();
}
}
}
/**
* Get the filename from: <td align="left"><tt><a href="foo"
* class="p">foo</a></tt></td>
*
* @param item
* @return
* @throws java.lang.Exception
*/
return node.getNodeValue();
}
/**
* Get the LastModified date from the <td>date</td>
* @todo fix the item
* @param item the node representing <td>
* @return last modified date of the file
* @throws java.lang.Exception if an error occurs
*/
}
/**
* Get the size from the: <td><tt>size</tt></td>
* @param item the node representing <td>
* @return The size
* @throws java.lang.Exception if an error occurs
*/
}
/**
* Validate this file-entry in the table
* @param element The <tr> element
* @throws java.lang.Exception
*/
if (len < 4) {
return;
}
// item(0) is a decoration placeholder, i.e. no content
// Try to look it up in the list of files
return;
}
}
}
/**
* Test directory listing
* @throws java.lang.Exception if an error occurs while generating the
* list.
*/
@Test
// add one extra for header and one for parent directory link
// Skip the the header and parent link
for (int i = 2; i < len; ++i) {
}
}
}