Added HTTP_DATE to ease http date manipulation and optimize code rather than using EiffelTime's code facilities.
Added autotests to `http' lib.
This commit is contained in:
15
library/network/protocol/http/tests/autotest.e
Normal file
15
library/network/protocol/http/tests/autotest.e
Normal file
@@ -0,0 +1,15 @@
|
||||
class
|
||||
AUTOTEST
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Initialize `Current'.
|
||||
do
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
45
library/network/protocol/http/tests/http_date_test_set.e
Normal file
45
library/network/protocol/http/tests/http_date_test_set.e
Normal file
@@ -0,0 +1,45 @@
|
||||
note
|
||||
description: "[
|
||||
Eiffel tests that can be executed by testing tool.
|
||||
]"
|
||||
author: "EiffelStudio test wizard"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
testing: "type/manual"
|
||||
|
||||
class
|
||||
HTTP_DATE_TEST_SET
|
||||
|
||||
inherit
|
||||
EQA_TEST_SET
|
||||
|
||||
feature -- Test routines
|
||||
|
||||
test_http_date
|
||||
-- New test routine
|
||||
local
|
||||
s: STRING
|
||||
d: HTTP_DATE
|
||||
do
|
||||
s := "Sun, 06 Nov 1994 08:49:37 GMT"
|
||||
|
||||
create d.make_from_string (s)
|
||||
assert ("RFC 1123", not d.has_error and then d.string.same_string (s))
|
||||
create d.make_from_timestamp (d.timestamp)
|
||||
assert ("RFC 1123", not d.has_error and then d.string.same_string (s))
|
||||
|
||||
s := "Sunday, 06-Nov-94 08:49:37 GMT"
|
||||
create d.make_from_string (s)
|
||||
assert ("RFC 850", not d.has_error and then d.rfc850_string.same_string (s))
|
||||
create d.make_from_timestamp (d.timestamp)
|
||||
assert ("RFC 850", not d.has_error and then d.rfc850_string.same_string (s))
|
||||
|
||||
|
||||
s := "Sun Nov 6 08:49:37 1994"
|
||||
create d.make_from_string (s)
|
||||
assert ("ANSI format", d.has_error)
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
18
library/network/protocol/http/tests/tests-safe.ecf
Normal file
18
library/network/protocol/http/tests/tests-safe.ecf
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="tests" uuid="0582ACC2-11D8-4FE5-888D-61837BA8F43E">
|
||||
<target name="tests">
|
||||
<root class="AUTOTEST" feature="make"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
|
||||
</option>
|
||||
<setting name="concurrency" value="none"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="http" location="..\http-safe.ecf" readonly="false"/>
|
||||
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/>
|
||||
<tests name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
18
library/network/protocol/http/tests/tests.ecf
Normal file
18
library/network/protocol/http/tests/tests.ecf
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="tests" uuid="0582ACC2-11D8-4FE5-888D-61837BA8F43E">
|
||||
<target name="tests">
|
||||
<root class="ANY" feature="default_create"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" void_safety="none" syntax="standard">
|
||||
</option>
|
||||
<setting name="concurrency" value="none"/>
|
||||
<library name="http" location="..\http.ecf"/>
|
||||
<library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/>
|
||||
<library name="testing" location="$ISE_LIBRARY/library/testing/testing.ecf"/>
|
||||
<tests name="src" location="." recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
Reference in New Issue
Block a user