1 /* 2 * Copyright (C) 2008 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 dxc.junit.argsreturns.pargsreturn; 18 19 import dxc.junit.DxTestCase; 20 import dxc.junit.argsreturns.pargsreturn.jm.T1; 21 import dxc.junit.argsreturns.pargsreturn.jm.T2; 22 import dxc.junit.argsreturns.pargsreturn.jm.T3; 23 import dxc.junit.argsreturns.pargsreturn.jm.T4; 24 25 public class Test_pargsreturn extends DxTestCase { 26 27 /** 28 * @title checks return value of a constant 29 */ 30 public void testN1() { 31 assertEquals(1234, new T1().run()); 32 } 33 34 /** 35 * @title checks whether the correct int value is returned. 36 */ 37 public void testN2() { 38 assertEquals(1234, new T2().run(1234)); 39 } 40 41 /** 42 * @title tests whether the correct int value is set. 43 */ 44 public void testN3() { 45 T3 t = new T3(); 46 t.run(1234); 47 assertEquals(1234, t.i1); 48 } 49 50 /** 51 * @title tests correct setting of field values 52 */ 53 public void testN4() { 54 T4 t = new T4(); 55 t.run(1234); 56 assertEquals(50000000000l, t.j1); 57 assertEquals(1234, t.i1); 58 } 59 60 61 62 63 } 64