3import static jau.test.net.URIDumpUtil.showUri;
5import java.io.IOException;
6import java.net.URISyntaxException;
9import org.jau.net.UriQueryProps;
10import org.junit.Assert;
11import org.junit.FixMethodOrder;
13import org.junit.runners.MethodSorters;
15import jau.test.junit.util.JunitTracer;
17@FixMethodOrder(MethodSorters.NAME_ASCENDING)
21 public void test() throws IOException, URISyntaxException {
22 final String SCHEME =
"camera";
23 final String HOST =
"somewhere";
24 final String PATH =
"0";
25 final String[] args =
new String[] {
26 SCHEME+
"://"+HOST+
"/"+PATH,
27 SCHEME+
"://"+HOST+
"/"+PATH+
"?p1=1",
29 for(
int i=0; i<args.length-1; i+=2) {
30 final String uri_s0 = args[i];
31 final String uri_s1 = args[i+1];
32 final Uri uri0 = Uri.cast(uri_s0);
33 final Uri uri1 = Uri.cast(uri_s1);
36 final UriQueryProps data = UriQueryProps.create(uri1,
';');
38 System.err.println(
"Error: NULL: <"+uri_s1+
"> -> "+uri1+
" -> NULL");
40 final Uri uri1T = data.appendQuery(uri0);
42 Assert.assertEquals(uri1, uri1T);
46 public static void main(
final String args[])
throws IOException {
48 org.junit.runner.JUnitCore.
main(tstname);
static void main(final String args[])