2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4 * Copyright 2009 Jonas Fonseca <fonseca@diku.dk>
6 * The contents of this file are subject to the terms of either the GNU
7 * General Public License Version 2 only ("GPL") or the Common
8 * Development and Distribution License("CDDL") (collectively, the
9 * "License"). You may not use this file except in compliance with the
10 * License. You can obtain a copy of the License at
11 * http://www.netbeans.org/cddl-gplv2.html. See the License for the
12 * specific language governing permissions and limitations under the
13 * License. When distributing the software, include this License Header
14 * Notice in each file.
16 * This particular file is subject to the "Classpath" exception as provided
17 * by Sun in the GPL Version 2 section of the License file that
18 * accompanied this code. If applicable, add the following below the
19 * License Header, with the fields enclosed by brackets [] replaced by
20 * your own identifying information:
21 * "Portions Copyrighted [year] [name of copyright owner]"
25 * If you wish your version of this file to be governed by only the CDDL
26 * or only the GPL Version 2, indicate your decision by adding
27 * "[Contributor] elects to include this software in this distribution
28 * under the [CDDL or GPL Version 2] license." If you do not indicate a
29 * single choice of license, a recipient has the option to distribute
30 * your version of this file under either the CDDL, the GPL Version 2 or
31 * to extend the choice of license to its licensees as provided above.
32 * However, if you add GPL Version 2 code and therefore, elected the GPL
33 * Version 2 license, then the option applies only if the new code is
34 * made subject to such option by the copyright holder.
36 package org
.nbgit
.client
;
38 import org
.nbgit
.OutputLogger
;
39 import org
.nbgit
.junit
.RepositoryTestCase
;
41 public class ClientBuilderTest
extends RepositoryTestCase
{
43 public ClientBuilderTest(String name
) {
47 public void testLogLimit() throws Exception
{
48 Builder builder
= new Builder().log(logger
);
50 for (int i
= 0; i
< OutputLogger
.MAX_LINES_TO_PRINT
+ 10; i
++)
51 builder
.log("line %d", i
);
53 assertEquals(OutputLogger
.MAX_LINES_TO_PRINT
, loggerMessages
.size());
56 private class Builder
extends ClientBuilder
{
59 super(ClientBuilderTest
.this.repository
);
62 Builder
log(OutputLogger logger
) {
63 return log(Builder
.class, logger
);