aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-09-22 02:50:38 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-09-22 02:50:38 +0900
commit89bf4b21ffb7d520cc911bb04e599aa76de8f325 (patch)
tree2729f67ef615cc371354b64f7dcd07173dcaa66b
parentf1f251c298276e6e49a187a36231cf5d1b8847d3 (diff)
downloadSmileEssence-89bf4b21ffb7d520cc911bb04e599aa76de8f325.tar.gz
no tests
-rw-r--r--app/src/androidTest/assets/directmessage.json151
-rw-r--r--app/src/androidTest/assets/reply.json145
-rw-r--r--app/src/androidTest/assets/retweet.json300
-rw-r--r--app/src/androidTest/assets/status.json122
-rw-r--r--app/src/androidTest/assets/user.json116
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/entity/TweetTest.java101
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/preference/SharedPreferenceHelperTest.java67
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/preference/UserPreferenceHelperTest.java52
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/twitter/TweetBuilderTest.java56
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/twitter/TwitterUtilsTest.java55
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/twitter/UserStreamListenerTest.java101
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/util/TwitterMock.java141
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/view/adapter/OrderedCustomListAdapterTest.java88
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/EventViewModelTest.java63
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/MessageViewModelTest.java45
-rw-r--r--app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/StatusViewModelTest.java45
l---------app/src/androidTest/resources/twitter4j.properties1
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/activity/MainActivity.java12
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/entity/User.java10
19 files changed, 1 insertions, 1670 deletions
diff --git a/app/src/androidTest/assets/directmessage.json b/app/src/androidTest/assets/directmessage.json
deleted file mode 100644
index 99c90e9b..00000000
--- a/app/src/androidTest/assets/directmessage.json
+++ /dev/null
@@ -1,151 +0,0 @@
- {
- "id":449134181964984320,
- "id_str":"449134181964984320",
- "text":"テスト",
- "sender":{
- "id":534042572,
- "id_str":"534042572",
- "name":"らこ(規制)",
- "screen_name":"laco0416_2",
- "location":"",
- "description":"規制垢だよバカヤロウ \r\n@laco0416",
- "url":null,
- "entities":{
- "description":{
- "urls":[
-
- ]
- }
- },
- "protected":false,
- "followers_count":429,
- "friends_count":283,
- "listed_count":20,
- "created_at":"Fri Mar 23 08:27:20 +0000 2012",
- "favourites_count":110,
- "utc_offset":32400,
- "time_zone":"Irkutsk",
- "geo_enabled":false,
- "verified":false,
- "statuses_count":994,
- "lang":"ja",
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/3169486255\/5b1ec018e0c13014f425916c59950dc1_normal.jpeg",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/3169486255\/5b1ec018e0c13014f425916c59950dc1_normal.jpeg",
- "profile_link_color":"0084B4",
- "profile_sidebar_border_color":"C0DEED",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":true,
- "default_profile_image":false,
- "following":true,
- "follow_request_sent":false,
- "notifications":false
- },
- "sender_id":534042572,
- "sender_id_str":"534042572",
- "sender_screen_name":"laco0416_2",
- "recipient":{
- "id":498602690,
- "id_str":"498602690",
- "name":"らこ",
- "screen_name":"laco0416",
- "location":"戦地 福岡",
- "description":"C#とかPythonとかJavaとか書きます\n\nhttps:\/\/t.co\/HaZ2B8rGTH\nお問い合せはこちらから。\nhttp:\/\/t.co\/sHp1REsW9I",
- "url":"http:\/\/t.co\/xf9c1YjWDo",
- "entities":{
- "url":{
- "urls":[
- {
- "url":"http:\/\/t.co\/xf9c1YjWDo",
- "expanded_url":"http:\/\/lacolaco.net",
- "display_url":"lacolaco.net",
- "indices":[
- 0,
- 22
- ]
- }
- ]
- },
- "description":{
- "urls":[
- {
- "url":"https:\/\/t.co\/HaZ2B8rGTH",
- "expanded_url":"https:\/\/twitter.com\/laco0416\/status\/441249190841032704",
- "display_url":"twitter.com\/laco0416\/statu…",
- "indices":[
- 24,
- 47
- ]
- },
- {
- "url":"http:\/\/t.co\/sHp1REsW9I",
- "expanded_url":"http:\/\/www.amazon.co.jp\/registry\/wishlist\/2FH7EWIU281C",
- "display_url":"amazon.co.jp\/registry\/wishl…",
- "indices":[
- 61,
- 83
- ]
- }
- ]
- }
- },
- "protected":false,
- "followers_count":2696,
- "friends_count":467,
- "listed_count":203,
- "created_at":"Tue Feb 21 07:00:56 +0000 2012",
- "favourites_count":60589,
- "utc_offset":32400,
- "time_zone":"Irkutsk",
- "geo_enabled":false,
- "verified":false,
- "statuses_count":180258,
- "lang":"ja",
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000034417975\/1a1c3c452a855698d8a1a56c2eeb5c12.jpeg",
- "profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000034417975\/1a1c3c452a855698d8a1a56c2eeb5c12.jpeg",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/427034943533772800\/5AAJv835_normal.png",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/427034943533772800\/5AAJv835_normal.png",
- "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/498602690\/1392430720",
- "profile_link_color":"0084B4",
- "profile_sidebar_border_color":"FFFFFF",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":false,
- "default_profile_image":false,
- "following":false,
- "follow_request_sent":false,
- "notifications":false
- },
- "recipient_id":498602690,
- "recipient_id_str":"498602690",
- "recipient_screen_name":"laco0416",
- "created_at":"Thu Mar 27 10:41:48 +0000 2014",
- "entities":{
- "hashtags":[
-
- ],
- "symbols":[
-
- ],
- "urls":[
-
- ],
- "user_mentions":[
-
- ]
- }
- } \ No newline at end of file
diff --git a/app/src/androidTest/assets/reply.json b/app/src/androidTest/assets/reply.json
deleted file mode 100644
index 64857a3a..00000000
--- a/app/src/androidTest/assets/reply.json
+++ /dev/null
@@ -1,145 +0,0 @@
- {
- "created_at":"Thu Mar 20 14:36:55 +0000 2014",
- "id":446656638397583361,
- "id_str":"446656638397583361",
- "text":"@laco0416 テスト #test http:\/\/t.co\/nd7Bzal2EU http:\/\/t.co\/yANfRHC4KW",
- "source":"<a href=\"http:\/\/youjo.manaita.info\/\" rel=\"nofollow\">Meltykiss<\/a>",
- "truncated":false,
- "in_reply_to_status_id":446655931942580224,
- "in_reply_to_status_id_str":"446655931942580224",
- "in_reply_to_user_id":498602690,
- "in_reply_to_user_id_str":"498602690",
- "in_reply_to_screen_name":"laco0416",
- "user":{
- "id":534042572,
- "id_str":"534042572",
- "name":"らこ(規制)",
- "screen_name":"laco0416_2",
- "location":"",
- "description":"規制垢だよバカヤロウ \r\n@laco0416",
- "url":null,
- "entities":{
- "description":{
- "urls":[
-
- ]
- }
- },
- "protected":false,
- "followers_count":423,
- "friends_count":285,
- "listed_count":20,
- "created_at":"Fri Mar 23 08:27:20 +0000 2012",
- "favourites_count":110,
- "utc_offset":32400,
- "time_zone":"Irkutsk",
- "geo_enabled":false,
- "verified":false,
- "statuses_count":993,
- "lang":"ja",
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/3169486255\/5b1ec018e0c13014f425916c59950dc1_normal.jpeg",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/3169486255\/5b1ec018e0c13014f425916c59950dc1_normal.jpeg",
- "profile_link_color":"0084B4",
- "profile_sidebar_border_color":"C0DEED",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":true,
- "default_profile_image":false,
- "following":true,
- "follow_request_sent":false,
- "notifications":false
- },
- "geo":null,
- "coordinates":null,
- "place":null,
- "contributors":null,
- "retweet_count":1,
- "favorite_count":0,
- "entities":{
- "hashtags":[
- {
- "text":"test",
- "indices":[
- 14,
- 19
- ]
- }
- ],
- "symbols":[
-
- ],
- "urls":[
- {
- "url":"http:\/\/t.co\/nd7Bzal2EU",
- "expanded_url":"http:\/\/www.google.com",
- "display_url":"google.com",
- "indices":[
- 20,
- 42
- ]
- }
- ],
- "user_mentions":[
- {
- "screen_name":"laco0416",
- "name":"らこ",
- "id":498602690,
- "id_str":"498602690",
- "indices":[
- 0,
- 9
- ]
- }
- ],
- "media":[
- {
- "id":446656638263377921,
- "id_str":"446656638263377921",
- "indices":[
- 43,
- 65
- ],
- "media_url":"http:\/\/pbs.twimg.com\/media\/BjLX2JRCQAE27mw.png",
- "media_url_https":"https:\/\/pbs.twimg.com\/media\/BjLX2JRCQAE27mw.png",
- "url":"http:\/\/t.co\/yANfRHC4KW",
- "display_url":"pic.twitter.com\/yANfRHC4KW",
- "expanded_url":"http:\/\/twitter.com\/laco0416_2\/status\/446656638397583361\/photo\/1",
- "type":"photo",
- "sizes":{
- "large":{
- "w":130,
- "h":130,
- "resize":"fit"
- },
- "medium":{
- "w":130,
- "h":130,
- "resize":"fit"
- },
- "thumb":{
- "w":130,
- "h":130,
- "resize":"crop"
- },
- "small":{
- "w":130,
- "h":130,
- "resize":"fit"
- }
- }
- }
- ]
- },
- "favorited":false,
- "retweeted":false,
- "possibly_sensitive":false,
- "lang":"ja"
- } \ No newline at end of file
diff --git a/app/src/androidTest/assets/retweet.json b/app/src/androidTest/assets/retweet.json
deleted file mode 100644
index c4363884..00000000
--- a/app/src/androidTest/assets/retweet.json
+++ /dev/null
@@ -1,300 +0,0 @@
-{
- "created_at":"Thu Mar 20 14:37:06 +0000 2014",
- "id":446656684262318080,
- "id_str":"446656684262318080",
- "text":"RT @laco0416_2: @laco0416 テスト #test http:\/\/t.co\/nd7Bzal2EU http:\/\/t.co\/yANfRHC4KW",
- "source":"<a href=\"http:\/\/youjo.manaita.info\/\" rel=\"nofollow\">Meltykiss<\/a>",
- "truncated":false,
- "in_reply_to_status_id":null,
- "in_reply_to_status_id_str":null,
- "in_reply_to_user_id":null,
- "in_reply_to_user_id_str":null,
- "in_reply_to_screen_name":null,
- "user":{
- "id":2336763169,
- "id_str":"2336763169",
- "name":"メカらこ弐号機",
- "screen_name":"la00c",
- "location":"",
- "description":"メカらこ2号機",
- "url":null,
- "entities":{
- "description":{
- "urls":[
-
- ]
- }
- },
- "protected":false,
- "followers_count":19,
- "friends_count":13,
- "listed_count":0,
- "created_at":"Mon Feb 10 14:19:04 +0000 2014",
- "favourites_count":0,
- "utc_offset":null,
- "time_zone":null,
- "geo_enabled":false,
- "verified":false,
- "statuses_count":2,
- "lang":"ja",
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/432882531659038720\/AvD6jrTy_normal.png",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/432882531659038720\/AvD6jrTy_normal.png",
- "profile_link_color":"0084B4",
- "profile_sidebar_border_color":"C0DEED",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":true,
- "default_profile_image":false,
- "following":true,
- "follow_request_sent":false,
- "notifications":false
- },
- "geo":null,
- "coordinates":null,
- "place":null,
- "contributors":null,
- "retweeted_status":{
- "created_at":"Thu Mar 20 14:36:55 +0000 2014",
- "id":446656638397583361,
- "id_str":"446656638397583361",
- "text":"@laco0416 テスト #test http:\/\/t.co\/nd7Bzal2EU http:\/\/t.co\/yANfRHC4KW",
- "source":"<a href=\"http:\/\/youjo.manaita.info\/\" rel=\"nofollow\">Meltykiss<\/a>",
- "truncated":false,
- "in_reply_to_status_id":446655931942580224,
- "in_reply_to_status_id_str":"446655931942580224",
- "in_reply_to_user_id":498602690,
- "in_reply_to_user_id_str":"498602690",
- "in_reply_to_screen_name":"laco0416",
- "user":{
- "id":534042572,
- "id_str":"534042572",
- "name":"らこ(規制)",
- "screen_name":"laco0416_2",
- "location":"",
- "description":"規制垢だよバカヤロウ \r\n@laco0416",
- "url":null,
- "entities":{
- "description":{
- "urls":[
-
- ]
- }
- },
- "protected":false,
- "followers_count":423,
- "friends_count":285,
- "listed_count":20,
- "created_at":"Fri Mar 23 08:27:20 +0000 2012",
- "favourites_count":110,
- "utc_offset":32400,
- "time_zone":"Irkutsk",
- "geo_enabled":false,
- "verified":false,
- "statuses_count":993,
- "lang":"ja",
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/3169486255\/5b1ec018e0c13014f425916c59950dc1_normal.jpeg",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/3169486255\/5b1ec018e0c13014f425916c59950dc1_normal.jpeg",
- "profile_link_color":"0084B4",
- "profile_sidebar_border_color":"C0DEED",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":true,
- "default_profile_image":false,
- "following":true,
- "follow_request_sent":false,
- "notifications":false
- },
- "geo":null,
- "coordinates":null,
- "place":null,
- "contributors":null,
- "retweet_count":1,
- "favorite_count":0,
- "entities":{
- "hashtags":[
- {
- "text":"test",
- "indices":[
- 14,
- 19
- ]
- }
- ],
- "symbols":[
-
- ],
- "urls":[
- {
- "url":"http:\/\/t.co\/nd7Bzal2EU",
- "expanded_url":"http:\/\/www.google.com",
- "display_url":"google.com",
- "indices":[
- 20,
- 42
- ]
- }
- ],
- "user_mentions":[
- {
- "screen_name":"laco0416",
- "name":"らこ",
- "id":498602690,
- "id_str":"498602690",
- "indices":[
- 0,
- 9
- ]
- }
- ],
- "media":[
- {
- "id":446656638263377921,
- "id_str":"446656638263377921",
- "indices":[
- 43,
- 65
- ],
- "media_url":"http:\/\/pbs.twimg.com\/media\/BjLX2JRCQAE27mw.png",
- "media_url_https":"https:\/\/pbs.twimg.com\/media\/BjLX2JRCQAE27mw.png",
- "url":"http:\/\/t.co\/yANfRHC4KW",
- "display_url":"pic.twitter.com\/yANfRHC4KW",
- "expanded_url":"http:\/\/twitter.com\/laco0416_2\/status\/446656638397583361\/photo\/1",
- "type":"photo",
- "sizes":{
- "large":{
- "w":130,
- "h":130,
- "resize":"fit"
- },
- "medium":{
- "w":130,
- "h":130,
- "resize":"fit"
- },
- "thumb":{
- "w":130,
- "h":130,
- "resize":"crop"
- },
- "small":{
- "w":130,
- "h":130,
- "resize":"fit"
- }
- }
- }
- ]
- },
- "favorited":false,
- "retweeted":false,
- "possibly_sensitive":false,
- "lang":"ja"
- },
- "retweet_count":1,
- "favorite_count":0,
- "entities":{
- "hashtags":[
- {
- "text":"test",
- "indices":[
- 30,
- 35
- ]
- }
- ],
- "symbols":[
-
- ],
- "urls":[
- {
- "url":"http:\/\/t.co\/nd7Bzal2EU",
- "expanded_url":"http:\/\/www.google.com",
- "display_url":"google.com",
- "indices":[
- 36,
- 58
- ]
- }
- ],
- "user_mentions":[
- {
- "screen_name":"laco0416_2",
- "name":"らこ(規制)",
- "id":534042572,
- "id_str":"534042572",
- "indices":[
- 3,
- 14
- ]
- },
- {
- "screen_name":"laco0416",
- "name":"らこ",
- "id":498602690,
- "id_str":"498602690",
- "indices":[
- 16,
- 25
- ]
- }
- ],
- "media":[
- {
- "id":446656638263377921,
- "id_str":"446656638263377921",
- "indices":[
- 59,
- 81
- ],
- "media_url":"http:\/\/pbs.twimg.com\/media\/BjLX2JRCQAE27mw.png",
- "media_url_https":"https:\/\/pbs.twimg.com\/media\/BjLX2JRCQAE27mw.png",
- "url":"http:\/\/t.co\/yANfRHC4KW",
- "display_url":"pic.twitter.com\/yANfRHC4KW",
- "expanded_url":"http:\/\/twitter.com\/laco0416_2\/status\/446656638397583361\/photo\/1",
- "type":"photo",
- "sizes":{
- "large":{
- "w":130,
- "h":130,
- "resize":"fit"
- },
- "medium":{
- "w":130,
- "h":130,
- "resize":"fit"
- },
- "thumb":{
- "w":130,
- "h":130,
- "resize":"crop"
- },
- "small":{
- "w":130,
- "h":130,
- "resize":"fit"
- }
- }
- }
- ]
- },
- "favorited":false,
- "retweeted":false,
- "possibly_sensitive":false,
- "lang":"ja"
- } \ No newline at end of file
diff --git a/app/src/androidTest/assets/status.json b/app/src/androidTest/assets/status.json
deleted file mode 100644
index 8a4032d4..00000000
--- a/app/src/androidTest/assets/status.json
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- "created_at":"Thu May 29 13:02:18 +0000 2014",
- "id":471999978789806080,
- "id_str":"471999978789806080",
- "text":"最近はGAE\/Goに夢中です。\n\nhttps:\/\/t.co\/HaZ2B8rGTH\n",
- "source":"<a href=\"http:\/\/youjo.manaita.info\/\" rel=\"nofollow\">Meltykiss<\/a>",
- "truncated":false,
- "in_reply_to_status_id":null,
- "in_reply_to_status_id_str":null,
- "in_reply_to_user_id":null,
- "in_reply_to_user_id_str":null,
- "in_reply_to_screen_name":null,
- "user":{
- "id":498602690,
- "id_str":"498602690",
- "name":"らこ",
- "screen_name":"laco0416",
- "location":"戦地 福岡",
- "description":"最近はGAE\/Goに夢中です。\n\nhttps:\/\/t.co\/HaZ2B8rGTH\nお問い合せはこちらから。\nhttp:\/\/t.co\/sHp1REsW9I",
- "url":"http:\/\/t.co\/xf9c1YjWDo",
- "entities":{
- "url":{
- "urls":[
- {
- "url":"http:\/\/t.co\/xf9c1YjWDo",
- "expanded_url":"http:\/\/lacolaco.net",
- "display_url":"lacolaco.net",
- "indices":[
- 0,
- 22
- ]
- }
- ]
- },
- "description":{
- "urls":[
- {
- "url":"https:\/\/t.co\/HaZ2B8rGTH",
- "expanded_url":"https:\/\/twitter.com\/laco0416\/status\/441249190841032704",
- "display_url":"twitter.com\/laco0416\/statu…",
- "indices":[
- 17,
- 40
- ]
- },
- {
- "url":"http:\/\/t.co\/sHp1REsW9I",
- "expanded_url":"http:\/\/www.amazon.co.jp\/registry\/wishlist\/2FH7EWIU281C",
- "display_url":"amazon.co.jp\/registry\/wishl…",
- "indices":[
- 54,
- 76
- ]
- }
- ]
- }
- },
- "protected":false,
- "followers_count":2821,
- "friends_count":490,
- "listed_count":231,
- "created_at":"Tue Feb 21 07:00:56 +0000 2012",
- "favourites_count":61175,
- "utc_offset":32400,
- "time_zone":"Irkutsk",
- "geo_enabled":false,
- "verified":false,
- "statuses_count":190668,
- "lang":"ja",
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000034417975\/1a1c3c452a855698d8a1a56c2eeb5c12.jpeg",
- "profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000034417975\/1a1c3c452a855698d8a1a56c2eeb5c12.jpeg",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/455388660485996544\/UEGvQy2B_normal.png",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/455388660485996544\/UEGvQy2B_normal.png",
- "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/498602690\/1392430720",
- "profile_link_color":"E6457A",
- "profile_sidebar_border_color":"FFFFFF",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":false,
- "default_profile_image":false,
- "following":null,
- "follow_request_sent":null,
- "notifications":null
- },
- "geo":null,
- "coordinates":null,
- "place":null,
- "contributors":null,
- "retweet_count":0,
- "favorite_count":0,
- "entities":{
- "hashtags":[
-
- ],
- "symbols":[
-
- ],
- "urls":[
- {
- "url":"https:\/\/t.co\/HaZ2B8rGTH",
- "expanded_url":"https:\/\/twitter.com\/laco0416\/status\/441249190841032704",
- "display_url":"twitter.com\/laco0416\/statu…",
- "indices":[
- 17,
- 40
- ]
- }
- ],
- "user_mentions":[
-
- ]
- },
- "favorited":true,
- "retweeted":false,
- "lang":"ja"
-} \ No newline at end of file
diff --git a/app/src/androidTest/assets/user.json b/app/src/androidTest/assets/user.json
deleted file mode 100644
index 34085e3e..00000000
--- a/app/src/androidTest/assets/user.json
+++ /dev/null
@@ -1,116 +0,0 @@
-{
- "id":498602690,
- "id_str":"498602690",
- "name":"らこ",
- "screen_name":"laco0416",
- "location":"戦地 福岡",
- "description":"C#とかPythonとかJavaとか書きます\n\nhttps:\/\/t.co\/HaZ2B8rGTH\nお問い合せはこちらから。\nhttp:\/\/t.co\/sHp1REsW9I",
- "url":"http:\/\/t.co\/xf9c1YjWDo",
- "entities":{
- "url":{
- "urls":[
- {
- "url":"http:\/\/t.co\/xf9c1YjWDo",
- "expanded_url":"http:\/\/lacolaco.net",
- "display_url":"lacolaco.net",
- "indices":[
- 0,
- 22
- ]
- }
- ]
- },
- "description":{
- "urls":[
- {
- "url":"https:\/\/t.co\/HaZ2B8rGTH",
- "expanded_url":"https:\/\/twitter.com\/laco0416\/status\/441249190841032704",
- "display_url":"twitter.com\/laco0416\/statu…",
- "indices":[
- 24,
- 47
- ]
- },
- {
- "url":"http:\/\/t.co\/sHp1REsW9I",
- "expanded_url":"http:\/\/www.amazon.co.jp\/registry\/wishlist\/2FH7EWIU281C",
- "display_url":"amazon.co.jp\/registry\/wishl…",
- "indices":[
- 61,
- 83
- ]
- }
- ]
- }
- },
- "protected":false,
- "followers_count":2710,
- "friends_count":466,
- "listed_count":206,
- "created_at":"Tue Feb 21 07:00:56 +0000 2012",
- "favourites_count":60016,
- "utc_offset":32400,
- "time_zone":"Irkutsk",
- "geo_enabled":false,
- "verified":false,
- "statuses_count":182229,
- "lang":"ja",
- "status":{
- "created_at":"Sun Apr 06 02:06:35 +0000 2014",
- "id":452628403242291200,
- "id_str":"452628403242291200",
- "text":"はて",
- "source":"<a href=\"http:\/\/youjo.manaita.info\/\" rel=\"nofollow\">Meltykiss<\/a>",
- "truncated":false,
- "in_reply_to_status_id":null,
- "in_reply_to_status_id_str":null,
- "in_reply_to_user_id":null,
- "in_reply_to_user_id_str":null,
- "in_reply_to_screen_name":null,
- "geo":null,
- "coordinates":null,
- "place":null,
- "contributors":null,
- "retweet_count":0,
- "favorite_count":0,
- "entities":{
- "hashtags":[
-
- ],
- "symbols":[
-
- ],
- "urls":[
-
- ],
- "user_mentions":[
-
- ]
- },
- "favorited":false,
- "retweeted":false,
- "lang":"ja"
- },
- "contributors_enabled":false,
- "is_translator":false,
- "is_translation_enabled":false,
- "profile_background_color":"C0DEED",
- "profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000034417975\/1a1c3c452a855698d8a1a56c2eeb5c12.jpeg",
- "profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000034417975\/1a1c3c452a855698d8a1a56c2eeb5c12.jpeg",
- "profile_background_tile":false,
- "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/451026853189275648\/_brGSjJ-_normal.png",
- "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/451026853189275648\/_brGSjJ-_normal.png",
- "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/498602690\/1392430720",
- "profile_link_color":"0084B4",
- "profile_sidebar_border_color":"FFFFFF",
- "profile_sidebar_fill_color":"DDEEF6",
- "profile_text_color":"333333",
- "profile_use_background_image":true,
- "default_profile":false,
- "default_profile_image":false,
- "following":false,
- "follow_request_sent":false,
- "notifications":false,
- "suspended":false,
- "needs_phone_verification":false
-} \ No newline at end of file
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/entity/TweetTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/entity/TweetTest.java
deleted file mode 100644
index b6629718..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/entity/TweetTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package net.lacolaco.smileessence.entity;
-
-import android.test.InstrumentationTestCase;
-import net.lacolaco.smileessence.util.TwitterMock;
-import twitter4j.TwitterObjectFactory;
-
-import java.util.EnumSet;
-
-public class TweetTest extends InstrumentationTestCase {
- TwitterMock mock;
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- }
-
- // begin: static methods
- public void testFetch() throws Exception {
- // register a Tweet
- Tweet sample = Tweet.fromTwitter(mock.getTweetRawMock(), 0);
- assertSame(sample, Tweet.fetch(sample.getId()));
- assertNull(Tweet.fetch(sample.getId() + 1));
- }
-
- public void testRemove() throws Exception {
- Tweet sample = Tweet.fromTwitter(mock.getTweetRawMock(), 0);
- Tweet.remove(sample.getId());
- assertNull(Tweet.fetch(sample.getId()));
- }
-
- public void testFromTwitterSingle() throws Exception {
- twitter4j.Status status = mock.getTweetRawMock();
- Tweet first = Tweet.fromTwitter(status, 0);
- Tweet second = Tweet.fromTwitter(status, 1);
- assertSame(first, second);
- }
- // end: static methods
-
- // begin: update
- public void testUpdateData() throws Exception {
- twitter4j.Status status = mock.getTweetRawMock();
- Tweet original = Tweet.fromTwitter(status, status.getUser().getId());
- assertEquals(status.getId(), original.getId());
- assertEquals(0, original.getFavoriteCount());
-
- String newJson = mock.getTweetJSONMock().replace("\"favorite_count\":0", "\"favorite_count\":100");
- assertTrue("[BUG] status.json is invalid", newJson.contains("\"favorite_count\":100"));
- twitter4j.Status updatedStatus = TwitterObjectFactory.createStatus(newJson);
-
- Tweet updated = Tweet.fromTwitter(updatedStatus, 12345L);
- assertEquals(100, updated.getFavoriteCount());
- assertTrue("favoriter list contains user_id 12345", updated.getFavoriters().contains(12345L));
- }
-
- public void testUpdateObserver() throws Exception {
- final O<EnumSet<RBinding>> changes = new O<>();
- twitter4j.Status status = mock.getTweetRawMock();
- Tweet original = Tweet.fromTwitter(status, 0);
- original.addObserver(this, changes_ -> changes.object = changes_);
-
- String newJson = mock.getTweetJSONMock().replace("\"favorite_count\":0", "\"favorite_count\":100");
- assertTrue("[BUG] status.json is invalid", newJson.contains("\"favorite_count\":100"));
- twitter4j.Status updatedStatus = TwitterObjectFactory.createStatus(newJson);
-
- Tweet.fromTwitter(updatedStatus, 0);
- assertTrue("changes contains REACTION_COUNT", changes.object.contains(RBinding.REACTION_COUNT));
- Tweet.fromTwitter(updatedStatus, 12345);
- assertTrue("changes contains FAVORITERS", changes.object.contains(RBinding.FAVORITERS));
- }
- // end: update
-
- // begin: instance methods
- public void testGetTwitterUrl() throws Exception {
- Tweet sample = Tweet.fromTwitter(mock.getTweetRawMock(), 0);
- assertTrue("twitter URL contains status ID", sample.getTwitterUrl().contains(String.valueOf(sample.getId())));
- }
-
- public void testAddFavoriter() throws Exception {
- Tweet sample = Tweet.fromTwitter(mock.getTweetRawMock(), 0);
- assertEquals(1, sample.getFavoriters().size());
- sample.addFavoriter(12345);
- assertEquals(2, sample.getFavoriters().size());
- }
-
- public void testRemoveFavoriter() throws Exception {
- Tweet sample = Tweet.fromTwitter(mock.getTweetRawMock(), 0);
- assertEquals(1, sample.getFavoriters().size());
- sample.removeFavoriter(0);
- assertEquals(0, sample.getFavoriters().size());
- }
-
- public void testGetEmbeddedStatusIds() throws Exception {
- Tweet sample = Tweet.fromTwitter(mock.getTweetRawMock(), 0);
- assertTrue(sample.getEmbeddedStatusIDs().contains(441249190841032704L));
- }
-
- // utility class
- static class O<T> {
- public T object;
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/preference/SharedPreferenceHelperTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/preference/SharedPreferenceHelperTest.java
deleted file mode 100644
index e5a517cb..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/preference/SharedPreferenceHelperTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.preference;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.test.InstrumentationTestCase;
-
-public class SharedPreferenceHelperTest extends InstrumentationTestCase {
-
- SharedPreferenceHelper helper;
-
- @Override
- public void setUp() throws Exception {
- //can't create on test context.
- helper = new SharedPreferenceHelper() {
- @Override
- protected SharedPreferences getPreferences() {
- return getInstrumentation().getTargetContext().getSharedPreferences("TestPreference", Context.MODE_PRIVATE);
- }
- };
- assertTrue(helper.set("test.sample", "test"));
- assertTrue(helper.set("test.empty", ""));
- }
-
- public void testGetProperty() throws Exception {
- String sample = helper.get("test.sample", "");
- assertEquals("test", sample);
- }
-
- public void testSetProperty() throws Exception {
- assertTrue(helper.set("test.sample", "test1"));
- assertEquals("test1", helper.get("test.sample", "notCorrect"));
- }
-
- public void testGetEmptyValue() throws Exception {
- String empty = helper.get("test.empty", "ax");
- assertEquals("", empty);
- }
-
- public void testNotExists() throws Exception {
- String notExists = helper.get("test.null", "no");
- assertEquals("no", notExists);
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/preference/UserPreferenceHelperTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/preference/UserPreferenceHelperTest.java
deleted file mode 100644
index 2b21b13c..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/preference/UserPreferenceHelperTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.preference;
-
-import android.test.AndroidTestCase;
-
-import net.lacolaco.smileessence.R;
-
-public class UserPreferenceHelperTest extends AndroidTestCase {
-
- private UserPreferenceHelper pref;
-
- @Override
- public void setUp() throws Exception {
- pref = UserPreferenceHelper.getInstance();
- }
-
- public void testNotFound() throws Exception {
- assertEquals("", pref.get(0, ""));
- }
-
- public void testUseDefault() throws Exception {
- assertNotSame(0, pref.get(R.string.key_setting_text_size, 10));
- }
-
- public void testPutAndGet() throws Exception {
- assertEquals(true, pref.set(R.string.key_test_preference, 10));
- assertEquals(10, pref.get(R.string.key_test_preference, 0));
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/twitter/TweetBuilderTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/twitter/TweetBuilderTest.java
deleted file mode 100644
index 7546ec0a..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/twitter/TweetBuilderTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.twitter;
-
-import android.test.InstrumentationTestCase;
-import net.lacolaco.smileessence.entity.Tweet;
-import net.lacolaco.smileessence.entity.User;
-import net.lacolaco.smileessence.util.TwitterMock;
-
-public class TweetBuilderTest extends InstrumentationTestCase {
-
- TwitterMock mock;
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- }
-
- public void testBuilder() throws Exception {
- User user = mock.getUserMock();
- Tweet status = mock.getReplyMock();
- TweetBuilder builder = new TweetBuilder();
- assertEquals("", builder.buildText());
- builder.addScreenName(user.getScreenName());
- builder.setText("test");
- assertEquals("@laco0416 test", builder.buildText());
- builder.appendText(" #test");
- assertEquals("@laco0416 test #test", builder.buildText());
- builder.setInReplyToStatusID(status.getInReplyToStatusId());
- assertEquals(status.getInReplyToStatusId(), builder.build().getInReplyToStatusId());
- builder.setMediaPath("");
- assertNotNull(builder.build());
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/twitter/TwitterUtilsTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/twitter/TwitterUtilsTest.java
deleted file mode 100644
index 9d9f9372..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/twitter/TwitterUtilsTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.twitter;
-
-import android.test.InstrumentationTestCase;
-import com.twitter.Validator;
-import junit.framework.Assert;
-
-public class TwitterUtilsTest extends InstrumentationTestCase {
-
- public void testLength() throws Exception {
- String text = "test";
- Assert.assertEquals(text.length(), new Validator().getTweetLength(text));
- text = "test.com";
- assertNotSame(text.length(), new Validator().getTweetLength(text));
- }
-/* TODO
- public void testURL() throws Exception {
- String screenName = "laco0416";
-
- assertEquals("https://twitter.com/laco0416", TwitterUtils.getUserHomeURL(screenName));
- assertEquals("http://favstar.fm/users/laco0416/recent", TwitterUtils.getFavstarRecentURL(screenName));
- assertEquals("http://aclog.koba789.com/laco0416/timeline", TwitterUtils.getAclogTimelineURL(screenName));
- assertEquals("http://twilog.org/laco0416", TwitterUtils.getTwilogURL(screenName));
- }
-
- public void testScreenNames() throws Exception {
- TwitterMock mock = new TwitterMock(getInstrumentation().getContext());
- Status retweetMock = mock.getRetweetMock();
- assertEquals(3, TwitterUtils.getScreenNames(retweetMock, null).size());
- assertEquals(2, TwitterUtils.getScreenNames(retweetMock, retweetMock.getUser().getScreenName()).size());
- }*/
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/twitter/UserStreamListenerTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/twitter/UserStreamListenerTest.java
deleted file mode 100644
index 7d97f51d..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/twitter/UserStreamListenerTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.twitter;
-
-import android.test.ActivityInstrumentationTestCase2;
-import net.lacolaco.smileessence.activity.MainActivity;
-import net.lacolaco.smileessence.entity.Tweet;
-import net.lacolaco.smileessence.entity.User;
-import net.lacolaco.smileessence.util.TwitterMock;
-import net.lacolaco.smileessence.viewmodel.EventViewModel;
-import twitter4j.Status;
-import twitter4j.StatusDeletionNotice;
-
-public class UserStreamListenerTest extends ActivityInstrumentationTestCase2<MainActivity> {
-
- TwitterMock mock;
- UserStreamListener listener;
-
- public UserStreamListenerTest() {
- super(MainActivity.class);
- }
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- listener = new UserStreamListener(mock.getAccount());
- }
-
- public void testOnStatus() throws Exception {
- Status status = mock.getTweetRawMock();
- Container<Tweet> a = new Container<>();
- Container<Long> b = new Container<>();
- StatusFilter.getInstance().register(this, Tweet.class,
- gotVm -> a.object = gotVm,
- gotId -> b.object = gotId);
- listener.onStatus(status);
- assertEquals(Tweet.fromTwitter(status, 0), a.object);
- listener.onDeletionNotice(new StatusDeletionNotice() {
- @Override
- public long getStatusId() {
- return status.getId();
- }
-
- @Override
- public long getUserId() {
- return status.getUser().getId();
- }
-
- @Override
- public int compareTo(StatusDeletionNotice another) {
- return 0;
- }
- });
- assertEquals(status.getId(), (long) b.object);
- StatusFilter.getInstance().unregister(this);
- }
-
- public void testOnFavorited() throws Exception {
- final Status status = mock.getReplyRawMock();
- final twitter4j.User source = mock.getUserRawMock();
- Container<EventViewModel> a = new Container<>();
- StatusFilter.getInstance().register(this, EventViewModel.class,
- gotVm -> a.object = gotVm,
- null);
- listener.onFavorite(source, source, status);
- assertNotNull(a.object);
- assertSame(User.fromTwitter(source), a.object.getSource());
- assertSame(Tweet.fromTwitter(status, mock.getUserMock().getId()), a.object.getTargetObject());
- }
-
- @Override
- protected void tearDown() throws Exception {
- getActivity().forceFinish();
- }
-
- static class Container<T> {
- public T object;
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/util/TwitterMock.java b/app/src/androidTest/java/net/lacolaco/smileessence/util/TwitterMock.java
deleted file mode 100644
index a111c76e..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/util/TwitterMock.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.util;
-
-import android.content.Context;
-import android.content.res.AssetManager;
-import net.lacolaco.smileessence.data.Account;
-import net.lacolaco.smileessence.entity.DirectMessage;
-import net.lacolaco.smileessence.entity.Tweet;
-import net.lacolaco.smileessence.entity.User;
-import twitter4j.*;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-public class TwitterMock {
-
- AssetManager assets;
-
- public TwitterMock(Context context) {
- assets = context.getAssets();
- }
-
- private String getJson(String fileName) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(assets.open(fileName)));
- StringBuilder builder = new StringBuilder();
- String str;
- while ((str = reader.readLine()) != null) {
- builder.append(str);
- }
- return builder.toString();
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- return null;
- }
-
- private String getOAuthToken(String name) throws IOException {
- String filename = "tokens.properties";
- Properties props = new Properties();
- InputStream is = null;
- try {
- is = assets.open(filename);
- props.load(is);
- return props.getProperty(name);
- } catch (Exception e) {
- throw e;
- } finally {
- if (is != null) {
- is.close();
- }
- }
- }
-
- public String getTweetJSONMock() throws IOException, TwitterException {
- return getJson("status.json");
- }
-
- public Status getTweetRawMock() throws IOException, TwitterException, JSONException {
- return TwitterObjectFactory.createStatus(getTweetJSONMock());
- }
-
- public Tweet getTweetMock() throws IOException, TwitterException, JSONException {
- return Tweet.fromTwitter(getTweetRawMock(), getUserMock().getId());
- }
-
- public Status getReplyRawMock() throws IOException, TwitterException {
- return TwitterObjectFactory.createStatus(getJson("reply.json"));
- }
-
- public Tweet getReplyMock() throws IOException, TwitterException {
- return Tweet.fromTwitter(getReplyRawMock(), getUserMock().getId());
- }
-
- public Status getRetweetRawMock() throws IOException, TwitterException {
- return TwitterObjectFactory.createStatus(getJson("retweet.json"));
- }
-
- public Tweet getRetweetMock() throws IOException, TwitterException {
- return Tweet.fromTwitter(getRetweetRawMock(), getUserMock().getId());
- }
-
- public twitter4j.User getUserRawMock() throws IOException, TwitterException {
- return TwitterObjectFactory.createUser(getJson("user.json"));
- }
-
- public User getUserMock() throws IOException, TwitterException {
- return User.fromTwitter(getUserRawMock());
- }
-
- public twitter4j.DirectMessage getDirectMessageRawMock() throws IOException, TwitterException {
- return TwitterObjectFactory.createDirectMessage(getJson("directmessage.json"));
- }
-
- public DirectMessage getDirectMessageMock() throws IOException, TwitterException {
- return DirectMessage.fromTwitter(getDirectMessageRawMock());
- }
-
- public String getAccessToken() throws IOException, JSONException {
- return getOAuthToken("accessToken");
- }
-
- public String getAccessTokenSecret() throws IOException, JSONException {
- return getOAuthToken("accessTokenSecret");
- }
-
- public Account getAccount() throws IOException, TwitterException, JSONException {
- return Account.register(getAccessToken(), getAccessTokenSecret(), getUserMock().getId(), getUserMock().getScreenName());
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/view/adapter/OrderedCustomListAdapterTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/view/adapter/OrderedCustomListAdapterTest.java
deleted file mode 100644
index c37d3551..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/view/adapter/OrderedCustomListAdapterTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.view.adapter;
-
-import android.test.ActivityInstrumentationTestCase2;
-import net.lacolaco.smileessence.activity.MainActivity;
-import net.lacolaco.smileessence.data.Account;
-import net.lacolaco.smileessence.util.TwitterMock;
-import net.lacolaco.smileessence.viewmodel.StatusViewModel;
-
-import java.util.Arrays;
-
-public class OrderedCustomListAdapterTest extends ActivityInstrumentationTestCase2<MainActivity> {
-
- TwitterMock mock;
- OrderedCustomListAdapter<StatusViewModel> adapter;
- Account account;
-
- public OrderedCustomListAdapterTest() {
- super(MainActivity.class);
- }
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- adapter = new OrderedCustomListAdapter<>(getActivity());
- account = mock.getAccount();
- }
-
- public void testAddItem() throws Exception {
- adapter.addItem(new StatusViewModel(mock.getReplyMock()));
- adapter.notifyDataSetChanged();
- assertEquals(1, adapter.getCount());
- }
-
- public void testUpdate() throws Exception {
- adapter.addItem(new StatusViewModel(mock.getReplyMock()));
- assertEquals(0, adapter.getCount());
- adapter.notifyDataSetChanged();
- assertEquals(1, adapter.getCount());
- }
-
- public void testAddItems() throws Exception {
- StatusViewModel viewModel1 = new StatusViewModel(mock.getReplyMock());
- StatusViewModel viewModel2 = new StatusViewModel(mock.getReplyMock());
- adapter.addItems(Arrays.asList(viewModel1, viewModel2));
- adapter.notifyDataSetChanged();
- assertEquals(2, adapter.getCount());
- }
-
- public void testRemoveItem() throws Exception {
- StatusViewModel viewModel1 = new StatusViewModel(mock.getReplyMock());
- StatusViewModel viewModel2 = new StatusViewModel(mock.getReplyMock());
- adapter.addItems(Arrays.asList(viewModel1, viewModel2));
- adapter.notifyDataSetChanged();
- assertEquals(2, adapter.getCount());
- adapter.removeItem(viewModel1);
- adapter.notifyDataSetChanged();
- assertEquals(1, adapter.getCount());
- }
-
- @Override
- protected void tearDown() throws Exception {
- getActivity().forceFinish();
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/EventViewModelTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/EventViewModelTest.java
deleted file mode 100644
index 767b5961..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/EventViewModelTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.viewmodel;
-
-import android.content.Context;
-import android.content.res.Configuration;
-import android.test.InstrumentationTestCase;
-import net.lacolaco.smileessence.R;
-import net.lacolaco.smileessence.entity.Tweet;
-import net.lacolaco.smileessence.entity.User;
-import net.lacolaco.smileessence.util.TwitterMock;
-
-import java.util.Locale;
-
-public class EventViewModelTest extends InstrumentationTestCase {
-
- TwitterMock mock;
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- }
-
- public void testNewInstance() throws Exception {
- Context context = getInstrumentation().getTargetContext();
- Tweet status = mock.getReplyMock();
- User source = mock.getUserMock();
- EventViewModel event = new EventViewModel(EventViewModel.EnumEvent.FAVORITED, source, status);
- assertEquals(source, event.getSource());
- assertEquals(status, event.getTargetObject());
- assertEquals(context.getString(R.string.format_event_favorited, source.getScreenName()), event.getFormattedString());
- event = new EventViewModel(EventViewModel.EnumEvent.RECEIVE_MESSAGE, source);
- Configuration config = context.getResources().getConfiguration();
- config.locale = Locale.ENGLISH;
- context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
- assertEquals(String.format("Received %s's message", source.getScreenName()), event.getFormattedString());
- config.locale = Locale.JAPANESE;
- context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
- assertEquals(String.format("%sからのDMを受信", source.getScreenName()), event.getFormattedString());
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/MessageViewModelTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/MessageViewModelTest.java
deleted file mode 100644
index e9d1acc9..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/MessageViewModelTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.viewmodel;
-
-import android.test.InstrumentationTestCase;
-import net.lacolaco.smileessence.entity.DirectMessage;
-import net.lacolaco.smileessence.util.TwitterMock;
-
-public class MessageViewModelTest extends InstrumentationTestCase {
-
- TwitterMock mock;
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- }
-
- public void testNewInstance() throws Exception {
- DirectMessage dm = mock.getDirectMessageMock();
- MessageViewModel viewModel = new MessageViewModel(dm);
- assertEquals(dm, viewModel.getDirectMessage());
- }
-}
diff --git a/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/StatusViewModelTest.java b/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/StatusViewModelTest.java
deleted file mode 100644
index bfb54b60..00000000
--- a/app/src/androidTest/java/net/lacolaco/smileessence/viewmodel/StatusViewModelTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.lacolaco.smileessence.viewmodel;
-
-import android.test.InstrumentationTestCase;
-import net.lacolaco.smileessence.entity.Tweet;
-import net.lacolaco.smileessence.util.TwitterMock;
-
-public class StatusViewModelTest extends InstrumentationTestCase {
-
- TwitterMock mock;
-
- @Override
- public void setUp() throws Exception {
- mock = new TwitterMock(getInstrumentation().getContext());
- }
-
- public void testTweetObject() throws Exception {
- Tweet tw = mock.getReplyMock();
- StatusViewModel status = new StatusViewModel(tw);
- assertSame(tw, status.getTweet());
- }
-}
diff --git a/app/src/androidTest/resources/twitter4j.properties b/app/src/androidTest/resources/twitter4j.properties
deleted file mode 120000
index 3d2f6829..00000000
--- a/app/src/androidTest/resources/twitter4j.properties
+++ /dev/null
@@ -1 +0,0 @@
-../../debug/resources/twitter4j.properties \ No newline at end of file
diff --git a/app/src/main/java/net/lacolaco/smileessence/activity/MainActivity.java b/app/src/main/java/net/lacolaco/smileessence/activity/MainActivity.java
index ee446890..1ce2b526 100644
--- a/app/src/main/java/net/lacolaco/smileessence/activity/MainActivity.java
+++ b/app/src/main/java/net/lacolaco/smileessence/activity/MainActivity.java
@@ -319,10 +319,6 @@ public class MainActivity extends Activity implements Application.OnCurrentAccou
openPostPage();
return true;
}
- /* TODO: case R.id.actionbar_search: {
- openSearchPage();
- return true;
- }*/
case R.id.actionbar_setting: {
startActivity(new Intent(this, SettingActivity.class));
return true;
@@ -335,18 +331,10 @@ public class MainActivity extends Activity implements Application.OnCurrentAccou
startActivity(new Intent(this, EditExtractionActivity.class));
return true;
}
- case R.id.actionbar_favstar: {
- IntentUtils.openUri(this, Application.getInstance().getCurrentAccount().getUser().getFavstarRecentURL());
- return true;
- }
case R.id.actionbar_aclog: {
IntentUtils.openUri(this, Application.getInstance().getCurrentAccount().getUser().getAclogTimelineURL());
return true;
}
- case R.id.actionbar_twilog: {
- IntentUtils.openUri(this, Application.getInstance().getCurrentAccount().getUser().getTwilogURL());
- return true;
- }
case R.id.actionbar_report: {
PostState.getState().beginTransaction()
.appendText(getString(R.string.text_message_to_author, BuildConfig.VERSION_NAME))
diff --git a/app/src/main/java/net/lacolaco/smileessence/entity/User.java b/app/src/main/java/net/lacolaco/smileessence/entity/User.java
index b6bce4c6..e1e3013f 100644
--- a/app/src/main/java/net/lacolaco/smileessence/entity/User.java
+++ b/app/src/main/java/net/lacolaco/smileessence/entity/User.java
@@ -178,15 +178,7 @@ public class User extends UIObservable {
}
public String getAclogTimelineURL() {
- return String.format("http://aclog.koba789.com/%s/timeline", getScreenName());
- }
-
- public String getFavstarRecentURL() {
- return String.format("http://favstar.fm/users/%s/recent", getScreenName());
- }
-
- public String getTwilogURL() {
- return String.format("http://twilog.org/%s", getScreenName());
+ return String.format("https://aclog.rhe.jp/%s/timeline", getScreenName());
}
public String getFormattedName() {