@@ -0,0 +1,3514 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A *  to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage org.apache.creadur.whisker.model;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.Collections;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class TestDescriptorRequiredNoticesNoThirdPartyNotices extends TestCase %7B%0A%0A    License primaryLicense = new License(false, %22This is the license text%22, Collections.%3CString%3E emptyList(), %22example.org%22, %22http://example.org%22, %22Example License%22);%0A    String primaryOrg = %22example.org%22;%0A    String primaryNotice = %22The primary notice.%22;%0A    Collection%3CWithinDirectory%3E contents = new ArrayList%3CWithinDirectory%3E();%0A    Map%3CString, License%3E licenses = new HashMap%3CString, License%3E();%0A    Map%3CString, String%3E notices = new HashMap%3CString, String%3E();%0A    Map%3CString, Organisation%3E organisations = new HashMap%3CString, Organisation%3E();%0A    %0A    Descriptor subject;%0A    %0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A        primaryLicense.storeIn(licenses);%0A    %7D%0A%0A    protected void tearDown() throws Exception %7B%0A        super.tearDown();%0A    %7D%0A%0A    public void testNoticeRequiredWhenPrimaryNoticeExists() throws Exception %7B%0A        subject = %0A                new Descriptor(primaryLicense, primaryOrg,  primaryNotice, %0A                        licenses, notices, organisations, contents);%0A        assertTrue(%22When primary notices exists, even if there are not other notices display is required%22, subject.isNoticeRequired());        %0A    %7D%0A%0A    public void testNoticeNotRequiredWhenPrimaryNoticeIsNullAndNoNotices() throws Exception %7B%0A        subject = %0A                new Descriptor(primaryLicense, primaryOrg,  null, %0A                        licenses, notices, organisations, contents);%0A        assertFalse(%22When no other notices exist and no primary notice, display is not required%22, %0A                subject.isNoticeRequired());        %0A    %7D%0A%0A    public void testNoticeNotRequiredWhenPrimaryNoticeIsEmptyAndNoNotices() throws Exception %7B%0A        subject = %0A                new Descriptor(primaryLicense, primaryOrg,  %22%22, %0A                        licenses, notices, organisations, contents);%0A        assertFalse(%22When no other notices exist and no primary notice, display is not required%22, %0A                subject.isNoticeRequired());        %0A    %7D%0A%0A    public void testNoticeNotRequiredWhenPrimaryNoticeIsWhitespaceAndNoNotices() throws Exception %7B%0A        subject = %0A                new Descriptor(primaryLicense, primaryOrg,  %22   %22, %0A                        licenses, notices, organisations, contents);%0A        assertFalse(%22When no other notices exist and no primary notice, display is not required%22, %0A                subject.isNoticeRequired());        %0A    %7D%0A%7D%0A

Start working on a similar test for a new method.