@@ -100,3 +100,32 @@ def test_301_native_package_starting_with_in_are_working(self):
100
100
except Exception as e :
101
101
print str (e )
102
102
assert 1 == 2 , 'Native packages starting with in could not be accessed'
103
+
104
+ def test_302_check_if_class_implements_java_interface (self ):
105
+ """
106
+ Test if java class implements java interface
107
+ https://github.com/NativeScript/android-runtime/issues/739
108
+ """
109
+ # Change main-page.js so it contains only logging information
110
+ source_js = os .path .join ('data' , "issues" , 'android-runtime-739' , 'main-page.js' )
111
+ target_js = os .path .join (self .app_name , 'app' , 'main-page.js' )
112
+ File .copy (src = source_js , dest = target_js )
113
+
114
+ Tns .platform_remove (platform = Platform .ANDROID , attributes = {"--path" : self .app_name }, assert_success = False )
115
+ Tns .platform_add_android (attributes = {"--path" : self .app_name , "--frameworkPath" : ANDROID_PACKAGE })
116
+ log = Tns .run_android (attributes = {'--path' : self .app_name , '--device' : EMULATOR_ID }, wait = False ,
117
+ assert_success = False )
118
+
119
+ strings = ['Project successfully built' ,
120
+ 'Successfully installed on device with identifier' , EMULATOR_ID ,
121
+ 'Successfully synced application' ]
122
+
123
+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 240 , check_interval = 10 , clean_log = False )
124
+ try :
125
+ Tns .wait_for_log (log_file = log , string_list = ["### TEST PASSED ###" ], timeout = 60 , check_interval = 10 ,
126
+ clean_log = False )
127
+ except Exception as e :
128
+ print str (e )
129
+ assert 1 == 2 , 'Check(instanceof) for java class implements java interface does not work' \
130
+ '(myRunnable instanceof java.lang.Runnable)'
131
+
0 commit comments