diff --git a/.ssh/id_rsa b/.ssh/id_rsa new file mode 100644 index 0000000..08e8098 --- /dev/null +++ b/.ssh/id_rsa @@ -0,0 +1,49 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn +NhAAAAAwEAAQAAAgEAnpuv8RHaJglT5l4rceA80qEidvBKBHOjGEDZO//yU3JurDAFY2DU +WIcLGPC21XCInixHqFEhQXcNIMCf1F/JeBFlo5xJ6Vip0B0i6DcMgMpyoh/Mqnq9UjwBsS +SPVftxTlV8bRJyp4KJqpWOwD+5r7LHWLxh6HZIIm0VMxau2B9Yeutew/YzMkCknz5b+EQ0 +osB85DckV/P4HR/YU061812XuWQRkw/rWAwxJc4z/eLcNyCVvIfGAKG8X6ao7RjMUEvlWT +XlpLfcJ5RU4TDa8na8KY0FjkAJFFPReI4d3UH13fiBSQe1ieO67wI1D3BRH7b/yRWfvkYS +C/DP25RWVT8Mp1sNxlDdMOMRRSkKAQ8R322yPxtn3fJPPA5vaxc+ojVF/7wuXZBrVOk+i2 +smzQW0oH06pNMZVlKsXetAQob8/bWzb9/T/VSx3Wz9byqIN7MSrEPjqdv1nMEUwG46hqhL +TR6JqK6GSKrifFJEj9b55F6CTYWAc8B63KLer3VvNq6yd5B4tu1SkQ36NrQHCdlAAGpKCb +m7sAks2MousTGyTCk+PLwFKKoJoqfi0+TdMwZp/AhZ4UwVrsG9v5lLuYrdmg4hVDjX2GYQ +s28BsDFjpiqKpPPRFbdE7vL5P3wr6T9Yb+SqIY3fY8bY2dne6O7SI1lUd4kDlJpDeGF+lD +0AAAdI/DBzxvwwc8YAAAAHc3NoLXJzYQAAAgEAnpuv8RHaJglT5l4rceA80qEidvBKBHOj +GEDZO//yU3JurDAFY2DUWIcLGPC21XCInixHqFEhQXcNIMCf1F/JeBFlo5xJ6Vip0B0i6D +cMgMpyoh/Mqnq9UjwBsSSPVftxTlV8bR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QtoVpcUydxvc47yF65JhLOXM6E +VjTVhE4JF1yUxr+h5WJPMeqcPnsO2Lkvi6/MrLXaLWNm+CaH3BG7YnFNDGbKZ/XfIiNPhn +qRZE6l9fwtMSkGuLBBAh97zrhdItWmnJD4IaeQYZ1WtVk+KR/Vj6LyNWLL4SIsoA3Y0WwX +8MPnPVjRpKMAAAATbWFhbmFzYTk1QGdtYWlsLmNvbQ== +-----END OPENSSH PRIVATE KEY----- diff --git a/.ssh/id_rsa.pub b/.ssh/id_rsa.pub new file mode 100644 index 0000000..0f81385 --- /dev/null +++ b/.ssh/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCem6/xEdomCVPmXitx4DzSoSJ28EoEc6MYQNk7//JTcm6sMAVjYNRYhwsY8LbVcIieLEeoUSFBdw0gwJ/UX8l4EWWjnEnpWKnQHSLoNwyAynKiH8yqer1SPAGxJI9V+3FOVXxtEnKngomqlY7AP7mvssdYvGHodkgibRUzFq7YH1h6617D9jMyQKSfPlv4RDSiwHzkNyRX8/gdH9hTTrXzXZe5ZBGTD+tYDDElzjP94tw3IJW8h8YAobxfpqjtGMxQS+VZNeWkt9wnlFThMNrydrwpjQWOQAkUU9F4jh3dQfXd+IFJB7WJ47rvAjUPcFEftv/JFZ++RhIL8M/blFZVPwynWw3GUN0w4xFFKQoBDxHfbbI/G2fd8k88Dm9rFz6iNUX/vC5dkGtU6T6LaybNBbSgfTqk0xlWUqxd60BChvz9tbNv39P9VLHdbP1vKog3sxKsQ+Op2/WcwRTAbjqGqEtNHomoroZIquJ8UkSP1vnkXoJNhYBzwHrcot6vdW82rrJ3kHi27VKRDfo2tAcJ2UAAakoJubuwCSzYyi6xMbJMKT48vAUoqgmip+LT5N0zBmn8CFnhTBWuwb2/mUu5it2aDiFUONfYZhCzbwGwMWOmKoqk89EVt0Tu8vk/fCvpP1hv5Kohjd9jxtjZ2d7o7tIjWVR3iQOUmkN4YX6UPQ== maanasa95@gmail.com diff --git a/Test case/test strategy b/Test case/test strategy new file mode 100644 index 0000000..1b994a4 --- /dev/null +++ b/Test case/test strategy @@ -0,0 +1,13 @@ +Testcase 1: Authentication to Github using username and password. +Testcase 2: Creating a repository and providing a name. +Testcase3: Cloning the code using the HTTP link provided and executing it in the Github command to connect to the project . Expected: Code that needs to be cloned is updated in the project. +Testcase 4: Generating API key by logging in to the Git server. API key is copied and pasted in the required code(classes.io) and executed. Expected: User must login inorder to check the API key. +Testcase 5: Install and add all the prerequisites needed to set up test framework and test environment in Java.(Maven/Gradle) +Testcase 6: Install GitBash and execute the commands needed to be setup ($Git- Init, registering username and email ID: $ git config --global user.name/$ git config --global email.ID +Testcase 7: Execute the required code and check for pass/fail. Once verified, code is committed and pushed to the github server. Expected: Successful push to the account, if error then check for the SSH key and repush. +Testcase 8: Create pull request in Github and execute the cases using Action command. Expected: Test case passed/ Test case failed( Recheck and raise issue in Git) +TEST STRATEGY: +Pre- installation of programming tools and the needed test environment.(Java required tools- Intellij, GitBash command, Command prompt) +Authentication to Github without any error. If using token, it is generated once, inorder to use another token change the name of the authentication to create new token. +RISK FACTORS: Pushing the code from Java to GitHub without errors, if error occurs, check the necessary methods by regenerating tokens to overcome the error. +Executing the code and getting passed/failed commands. If failed, code to be rechecked and re-executed, if same error occurs issue to be created in Git and tracked. diff --git a/pom.xml b/pom.xml index 78b5807..bd5e3d1 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,11 @@ 4.13.1 test + + com.detectlanguage + detectlanguage + 1.1.0 + @@ -98,8 +103,8 @@ maven-compiler-plugin 2.3.2 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/src/main/java/com/detectlanguage/Client.java b/src/main/java/com/detectlanguage/Client.java index e3ca76d..2650d44 100644 --- a/src/main/java/com/detectlanguage/Client.java +++ b/src/main/java/com/detectlanguage/Client.java @@ -25,7 +25,8 @@ public class Client { private static final String AGENT = "detectlanguage-java"; - public Client() { + public Client() {DetectLanguage.apiKey = "211b1c07ce6854eb6108137486393ca8"; + } public T execute(String method, Map params, diff --git a/src/main/java/com/detectlanguage/Result.java b/src/main/java/com/detectlanguage/Result.java index 6b2fb1b..23631e4 100644 --- a/src/main/java/com/detectlanguage/Result.java +++ b/src/main/java/com/detectlanguage/Result.java @@ -1,6 +1,9 @@ package com.detectlanguage; +import java.util.List; + public class Result { + public String language; public boolean isReliable; public double confidence; diff --git a/src/test/java/com/detectlanguage/GenericTest.java b/src/test/java/com/detectlanguage/GenericTest.java index 02a1e44..7406e96 100644 --- a/src/test/java/com/detectlanguage/GenericTest.java +++ b/src/test/java/com/detectlanguage/GenericTest.java @@ -17,6 +17,13 @@ public void testSimpleDetect() throws APIError { String language = DetectLanguage.simpleDetect("Hello world"); assertEquals(language, "en"); + List results = DetectLanguage.detect("Hello world"); + + Result result = results.get(0); + + System.out.println("Language: " + result.language); + System.out.println("Is reliable: " + result.isReliable); + System.out.println("Confidence: " + result.confidence); } @Test