-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mitsuru Shinmura
committed
Dec 30, 2013
1 parent
5dff08c
commit e7fd22e
Showing
14 changed files
with
161 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
mokumoku | ||
======== | ||
Android勉強会用プロジェクト | ||
|
||
practice aplication | ||
mkmk_otohime | ||
スイッチonで音が鳴るandroid.mediaを使用するサンプル | ||
|
||
mkmk_otohime_espresso_test | ||
espressoでのテストコードを試したサンプル | ||
実行時にeclipse上で「実行の構成」 テストタブのInstrumentation runner を | ||
com.google.android.apps.commons.testing.testrunner.GoogleInstrumentation.TestRunnerに変更する。 | ||
それ以外はJUnitと同様。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# files for the dex VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# generated files | ||
bin/ | ||
gen/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Eclipse project files | ||
.classpath | ||
.project | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Intellij project files | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# Robot Framework Test Server | ||
test_servers/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.mkmk_otohime.test" | ||
android:versionCode="1" | ||
android:versionName="1.0" > | ||
|
||
<uses-sdk android:minSdkVersion="14" /> | ||
|
||
<instrumentation | ||
android:name="android.test.InstrumentationTestRunner" | ||
android:targetPackage="com.example.mkmk_otohime" /> | ||
|
||
<instrumentation | ||
android:name="com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" | ||
android:targetPackage="com.example.mkmk_otohime" /> | ||
|
||
<application | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" > | ||
<uses-library android:name="android.test.runner" /> | ||
</application> | ||
|
||
</manifest> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# To enable ProGuard in your project, edit project.properties | ||
# to define the proguard.config property as described in that file. | ||
# | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in ${sdk.dir}/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the ProGuard | ||
# include property in project.properties. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system edit | ||
# "ant.properties", and override values to adapt the script to your | ||
# project structure. | ||
# | ||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): | ||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||
|
||
# Project target. | ||
target=android-17 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<string name="app_name">Mkmk_otohime_espresso_testTest</string> | ||
|
||
</resources> |
42 changes: 42 additions & 0 deletions
42
mkmk_otohime_espresso_test/src/com/example/mkmk_otohime/test/MainActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.example.mkmk_otohime.test; | ||
|
||
import com.example.mkmk_otohime.MainActivity; | ||
import com.example.mkmk_otohime.R; | ||
import android.test.ActivityInstrumentationTestCase2; | ||
import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData; | ||
import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; | ||
import static com.google.android.apps.common.testing.ui.espresso.Espresso.pressBack; | ||
import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; | ||
import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.closeSoftKeyboard; | ||
import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.typeText; | ||
import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; | ||
import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; | ||
import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; | ||
import static org.hamcrest.Matchers.allOf; | ||
import static org.hamcrest.Matchers.containsString; | ||
import static org.hamcrest.Matchers.instanceOf; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | ||
|
||
public MainActivityTest(Class<MainActivity> activityClass) { | ||
super(activityClass); | ||
} | ||
|
||
public MainActivityTest() { | ||
super(MainActivity.class); | ||
} | ||
|
||
@Override | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
// Espresso will not launch our activity for us, we must launch it via | ||
// getActivity(). | ||
getActivity(); | ||
} | ||
public void testdisplayName() { | ||
// TextViewにメッセージが表示されるかチェック | ||
onView(withId(R.id.textView1)).check(matches(withText("OTOHIME"))); | ||
} | ||
|
||
} |