/*<license>
  Copyright 2008, PeopleWare n.v.
  NO RIGHTS ARE GRANTED FOR THE USE OF THIS SOFTWARE, EXCEPT, IN WRITING,
  TO SELECTED PARTIES.
</license>*/

package org.ppwcode.metainfo_I;


import java.io.BufferedReader;
import java.io.Reader;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.ppwcode.metainfo_I.License.Type;


public class TestLicense_Type {

  @Before
  public void setUp() throws Exception {
    // NOP
  }

  @After
  public void tearDown() throws Exception {
    // NOP
  }

  private void test_getReader(Type lt) throws Exception {
    Reader licenseReader = lt.getReader();
    assertNotNull(licenseReader);
    assertTrue(licenseReader.ready());
    BufferedReader r = new BufferedReader(licenseReader);
    String firstLine = r.readLine();
    assertNotNull(firstLine);
    assertTrue(firstLine.length() > 0);
//    while (r.ready()) {
//      System.out.println(r.readLine());
//    }
  }

  @Test
  public void test_getLicense() throws Exception {
    for (Type lt : Type.values()) {
      test_getReader(lt);
    }
  }

}


@@ -5,18 +5,16 @@
 icense%3E%0A
-  
 Copyrigh
@@ -22,10 +22,21 @@
  200
-8,
+7 - $Date$ by
  Peo
@@ -51,104 +51,533 @@
 n.v.
-%0A  NO RIGHTS ARE GRANTED FOR THE USE OF THI
+.%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITION
 S 
-S
 OF
-TWARE, EXCEPT, IN WRITING,%0A  TO SELECTED PARTIES
+ ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License
 .%0A%3C/

correct license header