/*
 * Copyright 2009 55 Minutes (http://www.55minutes.com)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package fiftyfive.wicket.util;

import java.util.Calendar;
import java.util.Date;
import org.junit.Assert;
import org.junit.Test;

public class VersionTest
{
    /**
     * Inspect the wicket jar and verify its version information.
     */
    @Test
    public void testVersionOfJar()
    {
        Date now = new Date();
        Version v = Version.ofJar(org.apache.wicket.Component.class);
        
        Assert.assertEquals("1.4.2", v.getVersion());
        Assert.assertEquals("Wicket", v.getTitle());
        Assert.assertTrue(v.getModifiedDate().before(now));
        
        // Wicket 1.4.2 was built in September 2009
        Calendar expected = Calendar.getInstance();
        expected.set(Calendar.YEAR, 2009);
        expected.set(Calendar.MONTH, 8);
        expected.set(Calendar.DATE, 1);
        
        Calendar mod = Calendar.getInstance();
        mod.setTime(v.getModifiedDate());
        Assert.assertTrue(mod.after(expected));
    }
}

@@ -801,22 +801,25 @@
 ect the 
-wicket
+slf4j-api
  jar and
@@ -983,31 +983,20 @@
 org.
-apache.wicket.Component
+slf4j.Logger
 .cla
@@ -1040,19 +1040,19 @@
 uals(%221.
-4.2
+5.8
 %22, v.get
@@ -1092,22 +1092,25 @@
 Equals(%22
-Wicket
+slf4j-api
 %22, v.get
@@ -1203,20 +1203,23 @@
  // 
-Wicket 1.4.2
+slf4j-api 1.5.8
  was
@@ -1232,17 +1232,12 @@
  in 
-September
+June
  200
@@ -1370,17 +1370,17 @@
 .MONTH, 
-8
+5
 );%0A     

Test version of slf4j-api instead of wicket, since the latter changes too often.