Beginning of a simple test related to codegen.
This commit is contained in:
parent
3be354eb76
commit
7d901d34fb
@ -82,8 +82,8 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.5</source>
|
<source>1.6</source>
|
||||||
<target>1.5</target>
|
<target>1.6</target>
|
||||||
<compilerArgument>-proc:none</compilerArgument>
|
<compilerArgument>-proc:none</compilerArgument>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Gson Authors.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Gson Authors.
|
||||||
|
*
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user