/*
 * Copyright (C) 2008 Google Inc.
 *
 * 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 com.google.gson;

import junit.framework.TestCase;

/**
 * Unit tests for {@link GsonBuilder}.
 *
 * @author Inderjeet Singh
 */
public class GsonBuilderTest extends TestCase {

  public void testCreatingMoreThanOnce() {
    GsonBuilder builder = new GsonBuilder();
    builder.create();
    builder.create();
  }
}

@@ -633,16 +633,52 @@
 son;%0D%0A%0D%0A
+import java.lang.reflect.Modifier;%0D%0A
 import j
@@ -978,12 +978,711 @@
 );%0D%0A  %7D%0D
+%0A%0D%0A  public void testExcludeFieldsWithModifiers() %7B%0D%0A    Gson gson = new GsonBuilder()%0D%0A        .excludeFieldsWithModifiers(Modifier.VOLATILE, Modifier.PRIVATE)%0D%0A        .create();%0D%0A    assertEquals(%22%7B%5C%22d%5C%22:%5C%22d%5C%22%7D%22, gson.toJson(new HasModifiers()));%0D%0A  %7D%0D%0A%0D%0A  static class HasModifiers %7B%0D%0A    private String a = %22a%22;%0D%0A    volatile String b = %22b%22;%0D%0A    private volatile String c = %22c%22;%0D%0A    String d = %22d%22;%0D%0A  %7D%0D%0A%0D%0A  public void testTransientFieldExclusion() %7B%0D%0A    Gson gson = new GsonBuilder()%0D%0A        .excludeFieldsWithModifiers()%0D%0A        .create();%0D%0A    assertEquals(%22%7B%5C%22a%5C%22:%5C%22a%5C%22%7D%22, gson.toJson(new HasTransients()));%0D%0A  %7D%0D%0A%0D%0A  static class HasTransients %7B%0D%0A    transient String a = %22a%22;%0D%0A  %7D%0D
 %0A%7D%0D%0A

Test for excludeFieldsWithModifiers().