Fixup typo
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 14 Oct 2021 00:08:07 +0000 (09:08 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 28 Oct 2021 10:40:11 +0000 (19:40 +0900)
[Problem] There is an typo of SIGNATURE
[Solution] Fix it up

Change-Id: I487c2ebe7d989bf6ba9a39cc4ae362a640ff3cc2
Signed-off-by: Sung-jae Park <nicesj.park@samsung.com>
subprojects/libbeyond-android/src/androidTest/java/com/samsung/android/beyond/AuthenticatorUnitTest.java [deleted file]
subprojects/libbeyond-android/src/androidTest/java/com/samsung/android/beyond/AuthenticatorUnitTest/AuthenticatorUnitTest.java [new file with mode: 0644]
subprojects/libbeyond-android/src/main/jni/authenticator/beyond-authenticator_jni.cc

diff --git a/subprojects/libbeyond-android/src/androidTest/java/com/samsung/android/beyond/AuthenticatorUnitTest.java b/subprojects/libbeyond-android/src/androidTest/java/com/samsung/android/beyond/AuthenticatorUnitTest.java
deleted file mode 100644 (file)
index 03d3b93..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.samsung.android.beyond;
-
-import android.content.Context;
-import android.os.Looper;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import com.samsung.android.beyond.authenticator.Authenticator;
-import com.samsung.android.beyond.module.authenticator.SSL.SSLModule;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static android.os.Looper.myLooper;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(AndroidJUnit4.class)
-public class AuthenticatorUnitTest {
-
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-
-        assertEquals("com.samsung.android.beyond.test", appContext.getPackageName());
-    }
-
-    @Test
-    public void testPositiveCreate()
-    {
-        String[] args = {
-                SSLModule.NAME
-        };
-        Authenticator auth = new Authenticator(args);
-        assertNotNull(auth);
-        auth.close();
-    }
-
-    @Test
-    public void testPositiveConfigure()
-    {
-        String[] args = {
-                SSLModule.NAME
-        };
-        Authenticator auth = new Authenticator(args);
-        assertNotNull(auth);
-        int ret = auth.configure(ConfigType.JSON, "{'hello':'world'}");
-        assertEquals(ret, -22);
-        auth.close();
-    }
-
-    @Test
-    public void testPositivePrepare()
-    {
-        String[] args = {
-                SSLModule.NAME,
-        };
-        Authenticator auth = new Authenticator(args);
-        assertNotNull(auth);
-
-        auth.activate();
-
-        auth.prepare();
-
-        auth.deactivate();
-
-        auth.close();
-    }
-
-    @Test
-    public void testPositiveDestructor()
-    {
-        String[] args = {
-                SSLModule.NAME,
-        };
-
-        for (int i = 0; i < 10; i++) {
-
-            for (int j = 0; j < 100; j++) {
-                Object abc = new String[80000];
-                Authenticator auth;
-                auth = new Authenticator(args);
-                assertNotNull(auth);
-            }
-
-            try {
-                Thread.sleep(1000);
-            } catch (InterruptedException e) {
-
-            }
-        }
-
-
-    }
-
-    @Test
-    public void testPositivePrepareCA()
-    {
-        int ret;
-        String[] args = {
-                SSLModule.NAME,
-        };
-
-        Authenticator auth;
-        auth = new Authenticator(args);
-        assertNotNull(auth);
-        ret = auth.configure(ConfigType.JSON, "{\"ssl\": {\"bits\":-1,\"days\":365,\"serial\": 1,\"enable_base64\": 1,\"is_ca\": 1}}");
-        assertEquals(ret, 0);
-        ret = auth.activate();
-        assertEquals(ret, 0);
-        ret = auth.prepare();
-        assertEquals(ret, 0);
-
-        Authenticator authEE;
-        authEE = new Authenticator(args);
-        assertNotNull(authEE);
-        ret = authEE.configure(ConfigType.AUTHENTICATOR, auth);
-        assertEquals(ret, 0);
-        ret = authEE.configure(ConfigType.JSON, "{\"ssl\": {\"bits\":-1,\"days\":365,\"serial\": 1,\"enable_base64\": 1,\"is_ca\": 0}}");
-        assertEquals(ret, 0);
-        ret = authEE.activate();
-        assertEquals(ret, 0);
-        ret = authEE.prepare();
-        assertEquals(ret, 0);
-
-        ret = authEE.deactivate();
-        assertEquals(ret, 0);
-        authEE.close();
-
-        ret = auth.deactivate();
-        assertEquals(ret, 0);
-        auth.close();
-    }
-
-    @Test
-    public void testPositivePrepareAsync()
-    {
-        Looper.prepare();
-
-        String[] args = {
-                SSLModule.NAME,
-                SSLModule.ARGUMENT_ASYNC_MODE,
-        };
-        Authenticator auth = new Authenticator(args);
-        assertNotNull(auth);
-        AtomicInteger invoked = new AtomicInteger();
-        auth.setEventListener(eventObject -> {
-            assertEquals((eventObject.eventType & SSLModule.EVENT_TYPE_PREPARE_DONE), SSLModule.EVENT_TYPE_PREPARE_DONE);
-            invoked.getAndIncrement();
-            myLooper().quit();
-        });
-        auth.activate();
-        auth.prepare();
-
-        Looper.loop();
-        assertEquals(invoked.get(), 1);
-
-        auth.deactivate();
-        auth.close();
-    }
-}
diff --git a/subprojects/libbeyond-android/src/androidTest/java/com/samsung/android/beyond/AuthenticatorUnitTest/AuthenticatorUnitTest.java b/subprojects/libbeyond-android/src/androidTest/java/com/samsung/android/beyond/AuthenticatorUnitTest/AuthenticatorUnitTest.java
new file mode 100644 (file)
index 0000000..03d3b93
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.samsung.android.beyond;
+
+import android.content.Context;
+import android.os.Looper;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.samsung.android.beyond.authenticator.Authenticator;
+import com.samsung.android.beyond.module.authenticator.SSL.SSLModule;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static android.os.Looper.myLooper;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(AndroidJUnit4.class)
+public class AuthenticatorUnitTest {
+
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+        assertEquals("com.samsung.android.beyond.test", appContext.getPackageName());
+    }
+
+    @Test
+    public void testPositiveCreate()
+    {
+        String[] args = {
+                SSLModule.NAME
+        };
+        Authenticator auth = new Authenticator(args);
+        assertNotNull(auth);
+        auth.close();
+    }
+
+    @Test
+    public void testPositiveConfigure()
+    {
+        String[] args = {
+                SSLModule.NAME
+        };
+        Authenticator auth = new Authenticator(args);
+        assertNotNull(auth);
+        int ret = auth.configure(ConfigType.JSON, "{'hello':'world'}");
+        assertEquals(ret, -22);
+        auth.close();
+    }
+
+    @Test
+    public void testPositivePrepare()
+    {
+        String[] args = {
+                SSLModule.NAME,
+        };
+        Authenticator auth = new Authenticator(args);
+        assertNotNull(auth);
+
+        auth.activate();
+
+        auth.prepare();
+
+        auth.deactivate();
+
+        auth.close();
+    }
+
+    @Test
+    public void testPositiveDestructor()
+    {
+        String[] args = {
+                SSLModule.NAME,
+        };
+
+        for (int i = 0; i < 10; i++) {
+
+            for (int j = 0; j < 100; j++) {
+                Object abc = new String[80000];
+                Authenticator auth;
+                auth = new Authenticator(args);
+                assertNotNull(auth);
+            }
+
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+
+            }
+        }
+
+
+    }
+
+    @Test
+    public void testPositivePrepareCA()
+    {
+        int ret;
+        String[] args = {
+                SSLModule.NAME,
+        };
+
+        Authenticator auth;
+        auth = new Authenticator(args);
+        assertNotNull(auth);
+        ret = auth.configure(ConfigType.JSON, "{\"ssl\": {\"bits\":-1,\"days\":365,\"serial\": 1,\"enable_base64\": 1,\"is_ca\": 1}}");
+        assertEquals(ret, 0);
+        ret = auth.activate();
+        assertEquals(ret, 0);
+        ret = auth.prepare();
+        assertEquals(ret, 0);
+
+        Authenticator authEE;
+        authEE = new Authenticator(args);
+        assertNotNull(authEE);
+        ret = authEE.configure(ConfigType.AUTHENTICATOR, auth);
+        assertEquals(ret, 0);
+        ret = authEE.configure(ConfigType.JSON, "{\"ssl\": {\"bits\":-1,\"days\":365,\"serial\": 1,\"enable_base64\": 1,\"is_ca\": 0}}");
+        assertEquals(ret, 0);
+        ret = authEE.activate();
+        assertEquals(ret, 0);
+        ret = authEE.prepare();
+        assertEquals(ret, 0);
+
+        ret = authEE.deactivate();
+        assertEquals(ret, 0);
+        authEE.close();
+
+        ret = auth.deactivate();
+        assertEquals(ret, 0);
+        auth.close();
+    }
+
+    @Test
+    public void testPositivePrepareAsync()
+    {
+        Looper.prepare();
+
+        String[] args = {
+                SSLModule.NAME,
+                SSLModule.ARGUMENT_ASYNC_MODE,
+        };
+        Authenticator auth = new Authenticator(args);
+        assertNotNull(auth);
+        AtomicInteger invoked = new AtomicInteger();
+        auth.setEventListener(eventObject -> {
+            assertEquals((eventObject.eventType & SSLModule.EVENT_TYPE_PREPARE_DONE), SSLModule.EVENT_TYPE_PREPARE_DONE);
+            invoked.getAndIncrement();
+            myLooper().quit();
+        });
+        auth.activate();
+        auth.prepare();
+
+        Looper.loop();
+        assertEquals(invoked.get(), 1);
+
+        auth.deactivate();
+        auth.close();
+    }
+}
index 38270695aed25a7532ee6f9e8a9cbcd3a08aeac2..e8849537f6946cf97c102f3cef97d558a3312042 100644 (file)
@@ -30,7 +30,7 @@
 
 #define BEYOND_AUTHENTICATOR_EVENT_OBJECT_CLASS_NAME "com/samsung/android/beyond/authenticator/Authenticator$DefaultEventObject"
 #define BEYOND_AUTHENTICATOR_EVENT_OBJECT_CONSTRUCTOR_NAME "<init>"
-#define BEYOND_AUTHENTICATOR_EVENT_OBJECT_CONSTRUCTOR_SIGANTURE "()V"
+#define BEYOND_AUTHENTICATOR_EVENT_OBJECT_CONSTRUCTOR_SIGNATURE "()V"
 #define BEYOND_AUTHENTICATOR_EVENT_OBJECT_EVENT_TYPE_FIELD_NAME "eventType"
 #define BEYOND_AUTHENTICATOR_EVENT_OBJECT_EVENT_DATA_FIELD_NAME "eventData"
 
@@ -194,7 +194,7 @@ void AuthenticatorNativeInterface::Java_com_samsung_android_beyond_Authenticator
 
     eventObject.constructor = env->GetMethodID(eventObject.klass,
                                                BEYOND_AUTHENTICATOR_EVENT_OBJECT_CONSTRUCTOR_NAME,
-                                               BEYOND_AUTHENTICATOR_EVENT_OBJECT_CONSTRUCTOR_SIGANTURE);
+                                               BEYOND_AUTHENTICATOR_EVENT_OBJECT_CONSTRUCTOR_SIGNATURE);
     if (env->ExceptionCheck() == true) {
         JNIPrintException(env);
         env->DeleteGlobalRef(eventObject.klass);