Skip to content

Commit

Permalink
fix home page icons
Browse files Browse the repository at this point in the history
add jacoco
  • Loading branch information
Yougourta committed Mar 18, 2019
1 parent 067fcf7 commit 31290ae
Show file tree
Hide file tree
Showing 59 changed files with 163 additions and 2 deletions.
15 changes: 15 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'

jacoco {
toolVersion = "0.8.3"
}

tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}

android {
compileSdkVersion 28
Expand All @@ -10,10 +19,14 @@ android {
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

flavorDimensions "default"

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
testCoverageEnabled = true
}
}
dataBinding {
Expand All @@ -37,4 +50,6 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services-maps:16.0.0'

androidTestImplementation 'com.android.support.test:runner:1.0.0'
}
118 changes: 118 additions & 0 deletions app/src/androidTest/java/fr/smartrecruit/api/SmarRecruitApiTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package fr.smartrecruit.api;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.util.Log;
import android.widget.Toast;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import org.junit.Before;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import fr.smartrecruit.data.Applicant;
import fr.smartrecruit.data.DataConstants;
import fr.smartrecruit.data.JobOffer;
import fr.smartrecruit.data.Recruiter;

import static org.junit.Assert.assertEquals;


public class SmarRecruitApiTest {
private final String USER_ID = Applicant.getApplicant().getId();
private final String RECRUITER_ID = Recruiter.getRecruiter().getId();

private List<JobOffer> offers = new ArrayList();
private Context context;

@Before
public void setup() {
context = InstrumentationRegistry.getContext();
}

@Test
public void requestOffers() {
offers.clear();
RequestQueue queue = Volley.newRequestQueue(context);
final String url = DataConstants.SERVER_URL+"/offers?applicant="+USER_ID;
StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
JsonParser parser = new JsonParser();
JsonArray resultsJsonObject = parser.parse(s).getAsJsonObject().get("job-offers").getAsJsonArray();
for (int i=0; i<resultsJsonObject.size(); i++){
JsonObject jsonObject = resultsJsonObject.get(i).getAsJsonObject();
JobOffer jobOffer = new JobOffer();
jobOffer.setId(jsonObject.get("id").getAsString());
jobOffer.setPosition(jsonObject.get("position").getAsString());
jobOffer.setCompany(jsonObject.get("company").getAsString());
jobOffer.setLocation(jsonObject.get("location").getAsString());
jobOffer.setDatePosted(jsonObject.get("datePosted").getAsString());
jobOffer.setDescription(jsonObject.get("description").getAsString());
offers.add(jobOffer);
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
Log.d("Error", volleyError.getMessage());
}
});
queue.add(request);
assertEquals(0, offers.size());
}

@Test
public void removeFavorite() {
RequestQueue queue = Volley.newRequestQueue(context);
final String url = DataConstants.SERVER_URL+"/removeFavorite?applicant="+USER_ID+"&offer="+"1";
StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
JsonParser parser = new JsonParser();
String response = parser.parse(s).getAsJsonObject().get("response").getAsString();
if ("success".equals(response))
Toast.makeText(context, "Removed from favorites", Toast.LENGTH_SHORT).show();
else if ("error".equals(response))
Toast.makeText(context, "An error occurred x(", Toast.LENGTH_SHORT).show();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
Log.d("Error", volleyError.getMessage());
}
});
queue.add(request);
}

@Test
public void updateStatus() {
assertEquals(2, 1+1);
}

@Test
public void rejectApplication() {
assertEquals(2, 1+1);
}

@Test
public void requestOffersRecruiter() {
assertEquals(2, 1+1);
}

@Test
public void createOffer() {
assertEquals(2, 1+1);
}
}
Binary file added app/src/main/ic_applicant-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/ic_logo_v2-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/ic_recruiter-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public List<RecAppointment> getAppointments(Context context){
api.requestRecruiterAppointments();
return api.getRecruiterAppointments();
}

public void rejectApplication(String offerId){
api.rejectApplication(offerId);
}
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
android:id="@+id/btn_candidat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_search_foreground" />
android:background="@mipmap/ic_applicant_foreground" />

<TextView
android:id="@+id/textView1"
Expand Down Expand Up @@ -69,7 +69,9 @@
android:id="@+id/btn_recruiter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_cand_foreground" />
android:background="@mipmap/ic_recruiter_foreground"
android:scaleX="1.05"
android:scaleY="1.05" />

<TextView
android:id="@+id/textView2"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_applicant.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_applicant_foreground"/>
</adaptive-icon>
4 changes: 4 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_applicant_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_applicant_foreground"/>
</adaptive-icon>
4 changes: 4 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_logo_v2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_logo_v2_foreground"/>
</adaptive-icon>
4 changes: 4 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_logo_v2_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_logo_v2_foreground"/>
</adaptive-icon>
4 changes: 4 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_recruiter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_recruiter_foreground"/>
</adaptive-icon>
4 changes: 4 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_recruiter_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_recruiter_foreground"/>
</adaptive-icon>
Binary file added app/src/main/res/mipmap-hdpi/ic_applicant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-hdpi/ic_logo_v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-hdpi/ic_logo_v2_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-hdpi/ic_recruiter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_applicant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_logo_v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_logo_v2_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_recruiter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_applicant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_logo_v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_recruiter.png
Binary file added app/src/main/res/mipmap-xxhdpi/ic_applicant.png
Binary file added app/src/main/res/mipmap-xxhdpi/ic_logo_v2.png
Binary file added app/src/main/res/mipmap-xxhdpi/ic_recruiter.png
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_applicant.png
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_logo_v2.png
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_recruiter.png
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildscript {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4'
}
}

Expand Down

0 comments on commit 31290ae

Please sign in to comment.