Package org.simpleframework.http.resource

Source Code of org.simpleframework.http.resource.FileIndexerTest

package org.simpleframework.http.resource;

import java.io.File;

import junit.framework.TestCase;

import org.simpleframework.http.Address;
import org.simpleframework.http.parse.AddressParser;

public class FileIndexerTest extends TestCase {
  
   public void testFileIndexer() {
      FileIndexer indexer = new FileIndexer(new File("."));
      Address address = new AddressParser("/path/index.html");
     
      assertEquals(indexer.getContentType(address), "text/html");
      assertEquals(indexer.getPath(address).getName(), "index.html");
      assertEquals(indexer.getPath(address).getExtension(), "html");
      assertEquals(indexer.getPath(address).getDirectory(), "/path/");
     
   }

}
TOP

Related Classes of org.simpleframework.http.resource.FileIndexerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.