• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.test.example.helloworld;
18 
19 import android.support.test.filters.SmallTest;
20 import android.util.Log;
21 
22 import org.junit.After;
23 import org.junit.AfterClass;
24 import org.junit.Assert;
25 import org.junit.Before;
26 import org.junit.BeforeClass;
27 import org.junit.Test;
28 import org.junit.runner.RunWith;
29 import org.junit.runners.JUnit4;
30 
31 @RunWith(JUnit4.class)
32 public class HelloWorldTest {
33 
34     private static final String TAG = HelloWorldTest.class.getSimpleName();
35 
36     @BeforeClass
beforeClass()37     public static void beforeClass() {
38         Log.d(TAG, "beforeClass()");
39     }
40 
41     @AfterClass
afterClass()42     public static void afterClass() {
43         Log.d(TAG, "afterClass()");
44     }
45 
46     @Before
before()47     public void before() {
48         Log.d(TAG, "before()");
49     }
50 
51     @After
after()52     public void after() {
53         Log.d(TAG, "after()");
54     }
55 
56     @Test
57     @SmallTest
testHelloWorld()58     public void testHelloWorld() {
59         Log.d(TAG, "testHelloWorld()");
60         Assert.assertNotEquals("Hello", "world");
61     }
62 
63     @Test
64     @SmallTest
testHalloWelt()65     public void testHalloWelt() {
66         Log.d(TAG, "testHalloWelt()");
67         Assert.assertNotEquals("Hallo", "Welt");
68     }
69 }
70