Added tests for DateParser

Signed-off-by: Michael Hausegger <hausegger.michael@googlemail.com>
This commit is contained in:
Michael Hausegger 2019-05-16 17:52:05 +02:00 committed by Greg Wilkins
parent 8b4e6a34ac
commit d10f678e4c
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
//
// ========================================================================
// Copyright (c) 2019 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.http;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Unit tests for class {@link DateParser}.
*
* @see DateParser
*/
public class DateParserTest
{
@Test
public void testParseDateWithNonDateString()
{
assertEquals((-1L), DateParser.parseDate("3%~"));
}
@Test
public void testParseDateWithNonDateStringEndingWithGMT()
{
assertEquals((-1L), DateParser.parseDate("3%~ GMT"));
}
}