Skip to content

Commit 78e7ad1

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into add-kotlin-support
# Conflicts: # src/ServiceStackIDEA/src/main/java/net/servicestack/idea/AddServiceStackRefHandler.java
2 parents b28927c + d575bf1 commit 78e7ad1

File tree

196 files changed

+15965
-3981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+15965
-3981
lines changed

src/AndroidClient/.idea/gradle.xml

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AndroidClient/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AndroidClient/.idea/modules.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AndroidClient/AndroidClient.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.id="AndroidClient" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/client" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id="AndroidClient" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="java-gradle" name="Java-Gradle">
55
<configuration>

src/AndroidClient/android/android.iml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.id=":android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../client" external.system.id="GRADLE" external.system.module.group="net.servicestack" external.system.module.version="1.0.20" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id=":android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="net.servicestack" external.system.module.version="1.0.20" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
@@ -21,7 +21,7 @@
2121
<option name="ALLOW_USER_CONFIGURATION" value="false" />
2222
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
2323
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
24-
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
24+
<option name="RES_FOLDERS_RELATIVE_PATH" value="" />
2525
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
2626
<option name="LIBRARY_PROJECT" value="true" />
2727
</configuration>
@@ -71,27 +71,22 @@
7171
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
7272
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
7373
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
74-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
7574
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
7675
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
7776
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
78-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
7977
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
8078
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
81-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
8279
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
8380
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
84-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
8581
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
8682
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
8783
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
8884
</content>
89-
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
85+
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
9086
<orderEntry type="sourceFolder" forTests="false" />
91-
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
92-
<orderEntry type="library" exported="" name="gson-2.3.1" level="project" />
93-
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
94-
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
95-
<orderEntry type="module" module-name="client" exported="" />
87+
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
88+
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
89+
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
90+
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
9691
</component>
9792
</module>

src/AndroidClient/android/build.gradle

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ apply plugin: 'com.jfrog.bintray'
55
version = "1.0.20"
66

77
android {
8-
compileSdkVersion 21
9-
buildToolsVersion "21.1.2"
8+
compileSdkVersion 23
9+
buildToolsVersion "23.0.2"
1010

1111
defaultConfig {
1212
minSdkVersion 15
13-
targetSdkVersion 21
13+
targetSdkVersion 23
1414
versionCode 1
1515
versionName version
1616
}
@@ -20,13 +20,6 @@ android {
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
}
23-
packagingOptions {
24-
exclude 'META-INF/DEPENDENCIES'
25-
exclude 'META-INF/NOTICE'
26-
exclude 'META-INF/NOTICE.txt'
27-
exclude 'META-INF/LICENSE'
28-
exclude 'META-INF/LICENSE.txt'
29-
}
3023
}
3124

3225
Properties properties = System.properties;
@@ -70,7 +63,7 @@ install {
7063
licenses {
7164
license {
7265
name 'The BSD 3-Clause License'
73-
url 'https://raw.githubusercontent.com/ServiceStack/Assets/master/docs/license/LICENSE-BSD3.txt'
66+
url 'https://servicestack.net/bsd-license.txt'
7467
}
7568
}
7669

@@ -97,13 +90,10 @@ install {
9790
}
9891
}
9992

100-
10193
dependencies {
102-
compile 'com.android.support:appcompat-v7:21.0.3'
103-
compile project(':client')
104-
compile fileTree(dir: 'libs', include: '*.jar')
94+
compile 'com.google.code.gson:gson:2.4'
95+
compile 'com.android.support:appcompat-v7:23.1.1'
96+
compile fileTree(include: '*.jar', dir: 'libs')
10597
testCompile 'junit:junit:4.11'
10698
testCompile 'org.mockito:mockito-core:1.9.5'
10799
}
108-
109-
configurations.compile.exclude group: 'org.apache.httpcomponents'

src/AndroidClient/android/src/androidTest/java/net/servicestack/android/ExtendedRockstar.java renamed to src/AndroidClient/android/src/androidTest/java/net/servicestack/android/checkweb/ExtendedRockstar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package net.servicestack.android;
1+
package net.servicestack.android.checkweb;
22

33
/**
44
* Created by mythz on 6/30/2015.
55
*/
6-
public class ExtendedRockstar extends dto.Rockstar {
6+
public class ExtendedRockstar extends dtos.Rockstar {
77
public Integer ExtendedId = null;
88

99
public ExtendedRockstar(Integer extendedId) {
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// Copyright (c) 2015 ServiceStack LLC. All rights reserved.
2+
3+
package net.servicestack.android.checkweb;
4+
5+
import com.google.gson.Gson;
6+
7+
import junit.framework.TestCase;
8+
9+
import net.servicestack.android.checkweb.dtos.*;
10+
11+
import java.util.ArrayList;
12+
import java.util.List;
13+
14+
public class GsonTests extends TestCase {
15+
16+
public GsonTests() {
17+
18+
}
19+
20+
public void test_Gson() {
21+
System.out.println("=========== HELLO JSON ============");
22+
23+
String json = "{\n" +
24+
" \"posts\": [\n" +
25+
" {\n" +
26+
" \"post\": {\n" +
27+
" \"username\": \"John\",\n" +
28+
" \"message\": \"I'm back\",\n" +
29+
" \"time\": \"2010-5-6 7:00:34\"\n" +
30+
" }\n" +
31+
" },\n" +
32+
" {\n" +
33+
" \"post\": {\n" +
34+
" \"username\": \"Smith\",\n" +
35+
" \"message\": \"I've been waiting\",\n" +
36+
" \"time\": \"2010-4-6 10:30:26\"\n" +
37+
" }\n" +
38+
" }\n" +
39+
" ]\n" +
40+
"}";
41+
42+
Gson gson = new Gson();
43+
PostList list = gson.fromJson(json, PostList.class);
44+
45+
System.out.println("JSON: " + gson.toJson(list));
46+
}
47+
48+
public class PostList {
49+
private List<PostContainer> posts = new ArrayList<>();
50+
51+
public List<PostContainer> getPostContainterList() {
52+
return posts;
53+
}
54+
}
55+
56+
class PostContainer {
57+
Posts post;
58+
public Posts getPost() {
59+
return post;
60+
}
61+
}
62+
63+
public class Posts {
64+
String message;
65+
String time;
66+
String username;
67+
}
68+
69+
public static class dto
70+
{
71+
public static class Foo {
72+
Integer fooId;
73+
String fooName;
74+
}
75+
public static class Bar {
76+
Integer barId;
77+
String barName;
78+
Foo foo;
79+
}
80+
}
81+
82+
class NestedPojo {
83+
dto.Foo foo;
84+
dto.Bar bar;
85+
public Integer version = 1;
86+
}
87+
88+
class NestedList extends ArrayList<NestedPojo> {
89+
90+
}
91+
public static interface MetadataTestChild
92+
{
93+
public String name = null;
94+
// ArrayList<MetadataTestNestedChild> results;
95+
}
96+
97+
public void test_Can_serialize_nested_classes() {
98+
NestedPojo o = new NestedPojo();
99+
o.foo = new dto.Foo();
100+
o.foo.fooId = 1;
101+
o.foo.fooName = "foo";
102+
103+
o.bar = new dto.Bar();
104+
o.bar.barId = 2;
105+
o.bar.barName = "bar";
106+
107+
List<NestedPojo> list = new ArrayList<>();
108+
list.add(o);
109+
list.add(o);
110+
list.add(o);
111+
112+
Gson gson = new Gson();
113+
System.out.println("JSON LIST: " + gson.toJson(list));
114+
115+
Class a = NestedPojo.class;
116+
}
117+
118+
public void test_Can_deserialize_Hello() {
119+
String json = "{\"Result\":\"World\"}\n";
120+
121+
Gson gson = new Gson();
122+
123+
HelloResponse response = gson.fromJson(json, HelloResponse.class);
124+
125+
assertEquals("World", response.getResult());
126+
}
127+
}

src/AndroidClient/android/src/androidTest/java/net/servicestack/android/dto.java renamed to src/AndroidClient/android/src/androidTest/java/net/servicestack/android/checkweb/dtos.java

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,41 @@
33
Version: 1
44
BaseUrl: http://localhost:2020
55
6-
Package: servicestack.net.client.tests
6+
Package: net.servicestack.android.checkweb
77
//GlobalNamespace: dto
88
//AddPropertyAccessors: True
99
//SettersReturnThis: True
1010
//AddServiceStackTypes: True
1111
//AddResponseStatus: False
12-
//AddImplicitVersion:
13-
//IncludeTypes:
14-
//ExcludeTypes:
12+
//AddImplicitVersion:
13+
//IncludeTypes:
14+
//ExcludeTypes:
1515
//DefaultImports: java.math.*,java.util.*,net.servicestack.client.*
1616
*/
1717

18-
package net.servicestack.android;
19-
20-
import com.google.gson.annotations.SerializedName;
21-
22-
import java.math.*;
23-
import java.util.*;
24-
import net.servicestack.client.*;
25-
26-
public class dto
18+
package net.servicestack.android.checkweb;
19+
20+
import net.servicestack.client.Api;
21+
import net.servicestack.client.ApiMember;
22+
import net.servicestack.client.DataContract;
23+
import net.servicestack.client.DataMember;
24+
import net.servicestack.client.Flags;
25+
import net.servicestack.client.IReturn;
26+
import net.servicestack.client.IReturnVoid;
27+
import net.servicestack.client.Required;
28+
import net.servicestack.client.ResponseStatus;
29+
import net.servicestack.client.Route;
30+
import net.servicestack.client.StringLength;
31+
import net.servicestack.client.TimeSpan;
32+
33+
import java.math.BigDecimal;
34+
import java.math.BigInteger;
35+
import java.util.ArrayList;
36+
import java.util.Date;
37+
import java.util.HashMap;
38+
import java.util.UUID;
39+
40+
public class dtos
2741
{
2842

2943
public static class QueryBase_1<T> extends QueryBase

0 commit comments

Comments
 (0)