This commit is contained in:
parent
e822a4b35c
commit
91cadbb301
20 changed files with 342 additions and 130 deletions
|
|
@ -43,17 +43,28 @@ public class ConverterTest {
|
|||
assertEquals( 0x00, Converter.hexToByte('0','0') );
|
||||
assertEquals( 0x11, Converter.hexToByte('1','1') );
|
||||
assertEquals( 0x75, Converter.hexToByte('7','5') );
|
||||
assertEquals( 0xDA, Converter.hexToByte('D','A') );
|
||||
assertEquals( 0xFA, Converter.hexToByte('F','a') );
|
||||
assertEquals( 0xFF, Converter.hexToByte('f','f') );
|
||||
assertEquals( 0xDA, Converter.hexToByte('D','A') & 0xFF );
|
||||
assertEquals( 0xFA, Converter.hexToByte('F','a') & 0xFF );
|
||||
assertEquals( 0xFF, Converter.hexToByte('f','f') & 0xFF );
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testHexStringToByte() {
|
||||
assertArrayEquals( null, Converter.hexToByte(null) );
|
||||
assertArrayEquals( new byte[]{}, Converter.hexToByte("") );
|
||||
assertArrayEquals( new byte[]{0x00}, Converter.hexToByte("0x00") );
|
||||
assertArrayEquals( new byte[]{0x00}, Converter.hexToByte("00") );
|
||||
assertArrayEquals(new byte[]{0x07,0x06,0x05,0x04,0x03,0x02,0x01},
|
||||
Converter.hexToByte("01020304050607") );
|
||||
assertArrayEquals( new byte[]{0x11,0x0F}, Converter.hexToByte("F11") );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlEncode() {
|
||||
assertEquals( "fas8dg7%20a0d1%2313f9g8d7%200h9a%a4%25h0",
|
||||
Converter.urlEncode("fas8dg7 a0d1#13f9g8d7 0h9a<39>%h0") );
|
||||
assertEquals( "9i34%e5%202y92%a452%25%2623%20463765%a4(%2f%26(",
|
||||
Converter.urlEncode("9i34<EFBFBD> 2y92<39>52%&23 463765<36>(/&(") );
|
||||
assertEquals( "fas8dg7%20a0d1%2313f9g8d7%200h9a%25h0",
|
||||
Converter.urlEncode("fas8dg7 a0d1#13f9g8d7 0h9a%h0") );
|
||||
assertEquals( "9i34%202y9252%25%2623%20463765(%2f%26(",
|
||||
Converter.urlEncode("9i34 2y9252%&23 463765(/&(") );
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -61,8 +72,8 @@ public class ConverterTest {
|
|||
public void testUrlDecode() {
|
||||
assertEquals( "fas8dg7 a0d1#13f9g8d7 0h9a%h0",
|
||||
Converter.urlDecode("fas8dg7%20a0d1%2313f9g8d7%200h9a%25h0") );
|
||||
assertEquals( "9i34<EFBFBD> 2y9252%&23 463765(/&(",
|
||||
Converter.urlDecode("9i34%e5%202y9252%25%2623%20463765(%2f%26(") );
|
||||
assertEquals( "9i34 2y9252%&23 463765(/&(",
|
||||
Converter.urlDecode("9i34%202y9252%25%2623%20463765(%2f%26(") );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class HTTPGuessTheNumber implements HttpPage{
|
|||
|
||||
public static void main(String[] args) throws IOException{
|
||||
//HttpServer server = new HttpServer("localhost", 443, FileFinder.find("keySSL"), "rootroot");//SSL
|
||||
HttpServer server = new HttpServer("localhost", 8080);
|
||||
HttpServer server = new HttpServer(8080);
|
||||
server.setDefaultPage(new HTTPGuessTheNumber());
|
||||
server.run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import zutil.net.http.HttpServer;
|
|||
public class HTTPUploaderTest implements HttpPage{
|
||||
|
||||
public static void main(String[] args) throws IOException{
|
||||
HttpServer server = new HttpServer("localhost", 80);
|
||||
HttpServer server = new HttpServer(80);
|
||||
server.setDefaultPage(new HTTPUploaderTest());
|
||||
server.run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class UPnPServerTest {
|
|||
UPnPContentDirectory cds = new UPnPContentDirectory(new File("C:\\Users\\Ziver\\Desktop\\lan"));
|
||||
WebServiceDef ws = new WebServiceDef( UPnPContentDirectory.class );
|
||||
|
||||
HttpServer http = new HttpServer("http://192.168.0.60/", 8080);
|
||||
HttpServer http = new HttpServer(8080);
|
||||
//http.setDefaultPage(upnp);
|
||||
http.setPage("/RootDesc", upnp );
|
||||
http.setPage("/SCP/ContentDir", cds );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue