Skip to content

Commit 233b851

Browse files
committed
Merge pull request #100 from NativeScript/plamen5kov/fix_binding_generator_tests
fixed errors in binding generator tests
2 parents bd3b48e + c2b61bf commit 233b851

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

binding-generator/Tester/src/com/tns/runtimebindinggenerator/tester/RuntimeTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class RuntimeTests extends AndroidTestCase
4040
private ApplicationWriter aw;
4141
private Dump dump;
4242
private File optimizedDexOutputPath;
43+
public static final char CLASS_NAME_LOCATION_SEPARATOR = '_';
4344

44-
4545
public RuntimeTests()
4646
{
4747
}
@@ -120,7 +120,7 @@ private TargetObject loadProxy(File proxyFile, TargetObject implementationObject
120120
Platform.implementationObject = implementationObject;
121121

122122
DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
123-
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject-0");
123+
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject"+ CLASS_NAME_LOCATION_SEPARATOR + "0");
124124
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.TargetObject", clazz);
125125

126126
Constructor<?> ctor = clazz.getConstructor();
@@ -133,7 +133,7 @@ private <T> T loadAnyProxy(File proxyFile, T implementationObject) throws Except
133133
Platform.implementationObject = (Object)implementationObject;
134134

135135
DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
136-
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + implementationObject.getClass().getSuperclass().getCanonicalName() + "-0");
136+
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + implementationObject.getClass().getSuperclass().getCanonicalName() + CLASS_NAME_LOCATION_SEPARATOR + "0");
137137
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.Button1", clazz);
138138

139139
Constructor<?> ctor = clazz.getConstructor();
@@ -144,7 +144,7 @@ private <T> T loadAnyProxy(File proxyFile, T implementationObject) throws Except
144144
private <T> T loadAnyProxyByClass(File proxyFile, Class<?> proxyClass) throws Exception
145145
{
146146
DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
147-
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + proxyClass.getName().replace('$', '_') + "-0");
147+
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + proxyClass.getName().replace('$', '_') + CLASS_NAME_LOCATION_SEPARATOR + "0");
148148
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.Button1", clazz);
149149

150150
if (!proxyClass.getName().contains("ViewGroup"))
@@ -168,7 +168,7 @@ private Button1 loadButton1Proxy(File proxyFile, Button1 implementationObject) t
168168
Platform.implementationObject = implementationObject;
169169

170170
DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
171-
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.Button1-0");
171+
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.Button1" + CLASS_NAME_LOCATION_SEPARATOR + "0");
172172
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.Button1", clazz);
173173

174174
Constructor<?> ctor = clazz.getConstructor();
@@ -181,7 +181,7 @@ private TargetObject.TargetInterface loadInterfaceProxy(File proxyFile, TargetOb
181181
Platform.implementationObject = implementationObject;
182182

183183
DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
184-
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject_TargetInterface-0");
184+
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject_TargetInterface" + CLASS_NAME_LOCATION_SEPARATOR + "0");
185185
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.TargetObject", clazz);
186186

187187
Constructor<?> ctor = clazz.getConstructor();

0 commit comments

Comments
 (0)