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:
Jocelyn Fiat
2013-01-31 11:23:11 +01:00
parent 4369637140
commit 20d5798444
9 changed files with 746 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
class
AUTOTEST
create
make
feature {NONE} -- Initialization
make
-- Initialize `Current'.
do
end
end

View 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

View 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>

View 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>