Skip to content
Snippets Groups Projects

WIP: test: add URI testing

Closed Hugues.Cazeaux requested to merge HCA-URItesting into master
1 file
+ 32
0
Compare changes
  • Side-by-side
  • Inline
package ch.unige.solidify.test.util;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Paths;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
public class FileTest {
private static final Logger log = LoggerFactory.getLogger(FileTest.class);
private final static String TEST_FILE = "dlcm/dlcm.xml";
@Test
public void uriTest() throws IOException {
URI uri = Paths.get(new ClassPathResource(TEST_FILE).getPath()).toUri();
String t = uri.getRawPath();
log.info("URI=" + uri.toString());
log.info("Raw=" + t);
assertTrue(t.equals(uri.toString().substring(7)));
}
}
Loading