adding OpenCV Manager
This commit is contained in:
10
android/service/engine_test/.classpath
Normal file
10
android/service/engine_test/.classpath
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/JavaService"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
34
android/service/engine_test/.project
Normal file
34
android/service/engine_test/.project
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>JavaService</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
20
android/service/engine_test/AndroidManifest.xml
Normal file
20
android/service/engine_test/AndroidManifest.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.opencv.engine.test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="8" />
|
||||
|
||||
<instrumentation
|
||||
android:name="android.test.InstrumentationTestRunner"
|
||||
android:targetPackage="org.opencv.engine" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name" >
|
||||
<uses-library android:name="android.test.runner" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
android/service/engine_test/res/drawable-hdpi/ic_launcher.png
Normal file
BIN
android/service/engine_test/res/drawable-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
BIN
android/service/engine_test/res/drawable-ldpi/ic_launcher.png
Normal file
BIN
android/service/engine_test/res/drawable-ldpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
android/service/engine_test/res/drawable-mdpi/ic_launcher.png
Normal file
BIN
android/service/engine_test/res/drawable-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
12
android/service/engine_test/res/layout/main.xml
Normal file
12
android/service/engine_test/res/layout/main.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hello" />
|
||||
|
||||
</LinearLayout>
|
7
android/service/engine_test/res/values/strings.xml
Normal file
7
android/service/engine_test/res/values/strings.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="hello">Hello World!</string>
|
||||
<string name="app_name">JavaServiceTest</string>
|
||||
|
||||
</resources>
|
@@ -0,0 +1,65 @@
|
||||
package org.opencv.engine.test;
|
||||
|
||||
import org.opencv.engine.OpenCVEngineInterface;
|
||||
import org.opencv.engine.OpenCVEngineService;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.test.ServiceTestCase;
|
||||
|
||||
public class EngineInterfaceTest extends ServiceTestCase<OpenCVEngineService>
|
||||
{
|
||||
public EngineInterfaceTest()
|
||||
{
|
||||
super(OpenCVEngineService.class);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public void testVersion() throws RemoteException
|
||||
{
|
||||
IBinder ServiceBinder = bindService(new Intent("org.opencv.engine.BIND"));
|
||||
assertNotNull(ServiceBinder);
|
||||
OpenCVEngineInterface ServiceObj = OpenCVEngineInterface.Stub.asInterface(ServiceBinder);
|
||||
assertNotNull(ServiceObj);
|
||||
int ServiceVersion = ServiceObj.getEngineVersion();
|
||||
assertEquals(1, ServiceVersion);
|
||||
}
|
||||
|
||||
public void testInstallVersion() throws RemoteException
|
||||
{
|
||||
IBinder ServiceBinder = bindService(new Intent("org.opencv.engine"));
|
||||
assertNotNull(ServiceBinder);
|
||||
OpenCVEngineInterface ServiceObj = OpenCVEngineInterface.Stub.asInterface(ServiceBinder);
|
||||
assertNotNull(ServiceObj);
|
||||
assertTrue(ServiceObj.installVersion("2.4"));
|
||||
}
|
||||
|
||||
public void testGetPathForExistVersion() throws RemoteException
|
||||
{
|
||||
IBinder ServiceBinder = bindService(new Intent("org.opencv.engine"));
|
||||
assertNotNull(ServiceBinder);
|
||||
OpenCVEngineInterface ServiceObj = OpenCVEngineInterface.Stub.asInterface(ServiceBinder);
|
||||
assertNotNull(ServiceObj);
|
||||
assertEquals("/data/data/org.opencv.lib_v240_tegra3/lib", ServiceObj.getLibPathByVersion("2.4"));
|
||||
}
|
||||
|
||||
public void testGetPathForUnExistVersion() throws RemoteException
|
||||
{
|
||||
IBinder ServiceBinder = bindService(new Intent("org.opencv.engine"));
|
||||
assertNotNull(ServiceBinder);
|
||||
OpenCVEngineInterface ServiceObj = OpenCVEngineInterface.Stub.asInterface(ServiceBinder);
|
||||
assertNotNull(ServiceObj);
|
||||
assertEquals("", ServiceObj.getLibPathByVersion("2.5"));
|
||||
}
|
||||
|
||||
public void testInstallAndGetVersion() throws RemoteException
|
||||
{
|
||||
IBinder ServiceBinder = bindService(new Intent("org.opencv.engine"));
|
||||
assertNotNull(ServiceBinder);
|
||||
OpenCVEngineInterface ServiceObj = OpenCVEngineInterface.Stub.asInterface(ServiceBinder);
|
||||
assertNotNull(ServiceObj);
|
||||
assertTrue(ServiceObj.installVersion("2.4"));
|
||||
assertEquals("/data/data/org.opencv.lib_v240_tegra3/lib", ServiceObj.getLibPathByVersion("2.4"));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user