aboutsummaryrefslogtreecommitdiffstats
path: root/codegen/src/test/java/com/google
diff options
context:
space:
mode:
Diffstat (limited to 'codegen/src/test/java/com/google')
-rw-r--r--codegen/src/test/java/com/google/gson/codegen/functional/CodeGenFunctionalTest.java26
-rw-r--r--codegen/src/test/java/com/google/gson/codegen/functional/Order.java37
2 files changed, 63 insertions, 0 deletions
diff --git a/codegen/src/test/java/com/google/gson/codegen/functional/CodeGenFunctionalTest.java b/codegen/src/test/java/com/google/gson/codegen/functional/CodeGenFunctionalTest.java
new file mode 100644
index 00000000..855ee3fa
--- /dev/null
+++ b/codegen/src/test/java/com/google/gson/codegen/functional/CodeGenFunctionalTest.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2012 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.codegen.functional;
+
+import junit.framework.TestCase;
+
+public class CodeGenFunctionalTest extends TestCase {
+
+ public void testGeneratedJson() {
+ Order order = new Order("toy", 10);
+ // TODO: figure out how to access the generated type adapter
+ }
+}
diff --git a/codegen/src/test/java/com/google/gson/codegen/functional/Order.java b/codegen/src/test/java/com/google/gson/codegen/functional/Order.java
new file mode 100644
index 00000000..916587f3
--- /dev/null
+++ b/codegen/src/test/java/com/google/gson/codegen/functional/Order.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 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.codegen.functional;
+
+import com.google.gson.codegen.GeneratedTypeAdapter;
+
+@GeneratedTypeAdapter
+final class Order {
+ private final String itemName;
+ private final int price;
+
+ public Order(String itemName, int price) {
+ this.itemName = itemName;
+ this.price = price;
+ }
+
+ public String getItemName() {
+ return itemName;
+ }
+
+ public int getAmount() {
+ return price;
+ }
+}