org.apache.catalina.filters.ExpiresFilter.ExpiresConfiguration Java Examples

The following examples show how to use org.apache.catalina.filters.ExpiresFilter.ExpiresConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestExpiresFilter.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testParseExpiresConfigurationCombinedDuration() {
    ExpiresFilter expiresFilter = new ExpiresFilter();
    ExpiresConfiguration actualConfiguration = expiresFilter.parseExpiresConfiguration("access plus 1 month 15 days 2 hours");

    Assert.assertEquals(StartingPoint.ACCESS_TIME,
            actualConfiguration.getStartingPoint());

    Assert.assertEquals(3, actualConfiguration.getDurations().size());

}
 
Example #2
Source File: TestExpiresFilter.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testParseExpiresConfigurationMonoDuration() {
    ExpiresFilter expiresFilter = new ExpiresFilter();
    ExpiresConfiguration actualConfiguration = expiresFilter.parseExpiresConfiguration("access plus 2 hours");

    Assert.assertEquals(StartingPoint.ACCESS_TIME,
            actualConfiguration.getStartingPoint());

    Assert.assertEquals(1, actualConfiguration.getDurations().size());
    Assert.assertEquals(2,
            actualConfiguration.getDurations().get(0).getAmount());
    Assert.assertEquals(DurationUnit.HOUR,
            actualConfiguration.getDurations().get(0).getUnit());

}
 
Example #3
Source File: TestExpiresFilter.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Test
public void testParseExpiresConfigurationCombinedDuration() {
    ExpiresFilter expiresFilter = new ExpiresFilter();
    ExpiresConfiguration actualConfiguration = expiresFilter.parseExpiresConfiguration("access plus 1 month 15 days 2 hours");

    Assert.assertEquals(StartingPoint.ACCESS_TIME,
            actualConfiguration.getStartingPoint());

    Assert.assertEquals(3, actualConfiguration.getDurations().size());

}
 
Example #4
Source File: TestExpiresFilter.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Test
public void testParseExpiresConfigurationMonoDuration() {
    ExpiresFilter expiresFilter = new ExpiresFilter();
    ExpiresConfiguration actualConfiguration = expiresFilter.parseExpiresConfiguration("access plus 2 hours");

    Assert.assertEquals(StartingPoint.ACCESS_TIME,
            actualConfiguration.getStartingPoint());

    Assert.assertEquals(1, actualConfiguration.getDurations().size());
    Assert.assertEquals(2,
            actualConfiguration.getDurations().get(0).getAmount());
    Assert.assertEquals(DurationUnit.HOUR,
            actualConfiguration.getDurations().get(0).getUnit());

}
 
Example #5
Source File: TestExpiresFilter.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Test
public void testParseExpiresConfigurationCombinedDuration() {
    ExpiresFilter expiresFilter = new ExpiresFilter();
    ExpiresConfiguration actualConfiguration = expiresFilter.parseExpiresConfiguration("access plus 1 month 15 days 2 hours");

    Assert.assertEquals(StartingPoint.ACCESS_TIME,
            actualConfiguration.getStartingPoint());

    Assert.assertEquals(3, actualConfiguration.getDurations().size());

}
 
Example #6
Source File: TestExpiresFilter.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Test
public void testParseExpiresConfigurationMonoDuration() {
    ExpiresFilter expiresFilter = new ExpiresFilter();
    ExpiresConfiguration actualConfiguration = expiresFilter.parseExpiresConfiguration("access plus 2 hours");

    Assert.assertEquals(StartingPoint.ACCESS_TIME,
            actualConfiguration.getStartingPoint());

    Assert.assertEquals(1, actualConfiguration.getDurations().size());
    Assert.assertEquals(2,
            actualConfiguration.getDurations().get(0).getAmount());
    Assert.assertEquals(DurationUnit.HOUR,
            actualConfiguration.getDurations().get(0).getUnit());

}