Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
Merged

R4 #12

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c556ed5
new package, activity Sign In
KonstantinosLamprakis May 23, 2019
83cf4fa
new package, activity Sign In
KonstantinosLamprakis May 23, 2019
460772a
specify activity to launch
KonstantinosLamprakis May 24, 2019
3a1b23f
activity sign in changes
KonstantinosLamprakis May 24, 2019
f9a4b1d
activity sign in changes
KonstantinosLamprakis May 25, 2019
fcccef9
activity signΙn test implementation, new Interfaces
KonstantinosLamprakis May 25, 2019
2980615
activity signΙn test implementation, new Interfaces
KonstantinosLamprakis May 25, 2019
16e40b4
menu creation
KonstantinosLamprakis May 25, 2019
8cc0ce5
history search activity implementation
KonstantinosLamprakis May 25, 2019
42ca0b4
history search activity implementation
KonstantinosLamprakis May 25, 2019
bfe14b8
bugs fixxing Sign IN process
KonstantinosLamprakis May 25, 2019
1930492
Created service, service test, stub and linked to SignInService.
enderian May 25, 2019
34a35c2
More work done on services.
enderian May 25, 2019
c73960f
More work on the DAOs and the history.
enderian May 25, 2019
894b553
instances creation
KonstantinosLamprakis May 25, 2019
26b22c5
Some more changes.
enderian May 25, 2019
ff57986
Merge remote-tracking branch 'origin/branchR4' into branchR4
enderian May 25, 2019
d2a1429
Lab Activity half implementation
KonstantinosLamprakis May 26, 2019
b21f5df
Lab Activity half implementation
KonstantinosLamprakis May 26, 2019
117e994
menu modification, Configuration patterns addition
KonstantinosLamprakis May 26, 2019
c497ccd
menu modification, Configuration patterns addition
KonstantinosLamprakis May 26, 2019
8d7a2e3
Switched to fragments.
enderian May 26, 2019
4dfaa82
Merge remote-tracking branch 'origin/branchR4' into branchR4
enderian May 26, 2019
48e4bf3
menu modification, Configuration patterns addition
KonstantinosLamprakis May 26, 2019
18d240c
menu modification, Configuration patterns addition
KonstantinosLamprakis May 26, 2019
20eceb9
baroratory view update
KonstantinosLamprakis May 26, 2019
39f20bf
bug fixing
KonstantinosLamprakis May 26, 2019
b2a9962
bug fixing
KonstantinosLamprakis May 26, 2019
4c2b99e
bug fixing
KonstantinosLamprakis May 26, 2019
c5e7bb5
Merge remote-tracking branch 'origin/branchR4' into branchR4
enderian May 26, 2019
75ec672
Merge remote-tracking branch 'origin/branchR4' into branchR4
enderian May 26, 2019
2795e4e
Switched to fragments.
enderian May 26, 2019
81e1047
Wrote Lab Service
MrGoumX May 26, 2019
8aa50d5
Added Tests for Lab Service
MrGoumX May 26, 2019
99f2c0e
New activities, changes to fragments.
enderian May 26, 2019
cc04386
New activities, changes to fragments.
enderian May 26, 2019
0391360
Wrote configuration service and tests
MrGoumX May 26, 2019
33c3f52
Merge remote-tracking branch 'origin/branchR4' into branchR4
MrGoumX May 26, 2019
082325f
Added new configuration.
enderian May 26, 2019
a7526d5
Added terminal service and fragment
MrGoumX May 26, 2019
ba11938
Merge remote-tracking branch 'origin/branchR4' into branchR4
MrGoumX May 26, 2019
403577c
More additions.
enderian May 26, 2019
7f50ba7
Added terminal service and fragment
MrGoumX May 26, 2019
5bf958f
Finished testing for now
MrGoumX May 26, 2019
67c7d5a
Fixed some DAO tests
MrGoumX May 26, 2019
3c2b2f6
Started writing JavaDoc
May 26, 2019
b0d8f23
Finished terminal fragment and testing
MrGoumX May 27, 2019
7cca1af
Configuration addition/editing done.
enderian May 27, 2019
6c8a13b
Added terminal registration
MrGoumX May 27, 2019
a1ec8d0
Merge remote-tracking branch 'origin/branchR4' into branchR4
MrGoumX May 27, 2019
34737b6
Lab/terminal changes.
enderian May 27, 2019
b5fd785
Merge remote-tracking branch 'origin/branchR4' into branchR4
enderian May 27, 2019
c0c5425
Finished the app (i hope) & wrote A LOT of Java Doc
MrGoumX May 27, 2019
a853237
Drafted README.
enderian May 27, 2019
1ece7a1
Drafted README.
enderian May 27, 2019
a7cfd6f
Finished Java Doc on main package
MrGoumX May 27, 2019
d2ac31c
Finished Java Doc in Test package
MrGoumX May 27, 2019
79eb515
Little fix to R3 & final bug fixes to R4
MrGoumX May 27, 2019
f91e2c1
Changes to README
MrGoumX May 27, 2019
f2dcd23
Fix in DAO Tests
MrGoumX May 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
35 changes: 35 additions & 0 deletions Deliverables/R3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
###### Παραδοτέο R3

> Έχει γίνει και μερική υλοποίηση του παραδοτέου με Guice (dependency injection) και Mockito στο branch R3-Guice.

# Εισαγωγή

Στο παρών έγγραφο θα αναλυθούν η λογική της αρχιτεκτονικής και τα διαγράμματα ακολουθίας για την λογική πεδίου. Στο τέλος θα αναρτηθεί coverage report για τον κώδικα.

# Αρχιτεκτονική Λογισμικού

## Διάγραμμα πακέτων

![](package-diagram.png)

Τα πακέτα builder, configurations, lab, people, schedule ανήκουν στο domain model. Το πακέτα dao & memorydao προσφέρουν πρόσβαση στα δεδομένα μας (Direct Memory Access). Τέλος έχουμε εφαρμόσει το μοντέλο model view presenter για τα fragments που θα δημιουργηθούν στο R4.

# Στατική Όψη Λογικής Πεδίου

Παρακάτω παρουσιάζεται διαγραμματικά η στατική όψη της λογικής πεδίου.

![](static-view.png)

# Διαγράμματα Ακολουθίας Δυναμικής Όψης Λογικής Πεδίου

Παρακάτω παρουσιάζεται διαγραμματικά το διάγραμμα ακολουθίας για το signIn ενός χρήστη.

![](signin-seq.png)

# Υλοποίηση Λογικής Πεδίου & Testing

Η υλοποίηση της λογικής πεδίου και το testing μπορούν να βρεθούν στο Android Studio Project που έχει αναρτηθεί.

# Coverage Reports

Το report για το coverage του κώδικα μπορεί να δημιουργηθεί μέσα από το Android Studio (Analyze -> Generate Coverage Report), αλλά συνοπτικά είχαμε 95% coverage στις κλάσεις, 99% coverage στις μεθόδους & 96% coverage στις γραμμές.
Binary file added Deliverables/R3/package-diagram_old.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 modified Deliverables/R3/static-view.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 Deliverables/R4/class-diagram.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 Deliverables/R4/configuration-save.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 Deliverables/R4/history-read.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 Deliverables/R4/sign-in.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
###### Παραδοτέο R3

> Έχει γίνει και μερική υλοποίηση του παραδοτέου με Guice (dependency injection) και Mockito στο branch R3-Guice.
###### Παραδοτέο R4

# Εισαγωγή

Στο παρών έγγραφο θα αναλυθούν η λογική της αρχιτεκτονικής και τα διαγράμματα ακολουθίας για την λογική πεδίου. Στο τέλος θα αναρτηθεί coverage report για τον κώδικα.
Στο παρών έγγραφο θα αναλυθεί η τελική υλοποίηση της εφαρμογής στο Android framework.

# Αρχιτεκτονική Λογισμικού

## Διάγραμμα πακέτων
## Διάγραμμα κλάσεων

![](Deliverables/R3/package-diagram.png)
Παρακάτων παρουσιάζεται το διάγραμμα κλάσεων που εμπεριέχει όλο το project. Δυστυχώς είναι δυσανάγνωστο από το αρχείο της Markdown.

Τα πακέτα builder, configurations, lab, people, schedule ανήκουν στο domain model. Το πακέτα dao & memorydao προσφέρουν πρόσβαση στα δεδομένα μας (Direct Memory Access). Τέλος έχουμε εφαρμόσει το μοντέλο model view presenter για τα fragments που θα δημιουργηθούν στο R4.
![](Deliverables/R4/class-diagram.png)

# Στατική Όψη Λογικής Πεδίου
## Διάγραμμα πακέτων

Παρακάτω παρουσιάζεται διαγραμματικά η στατική όψη της λογικής πεδίου.
![](Deliverables/R3/package-diagram.png)

![](Deliverables/R3/static-view.png)
Τα πακέτα builder, configurations, lab, people, schedule ανήκουν στο domain model.
Το πακέτα dao & memorydao προσφέρουν πρόσβαση στα δεδομένα μας (Direct Memory Access).
Το πακέτο services περιέχει τις υπηρεσίες (services), που εδώ λειτουργούν ως presenters.

# Διαγράμματα Ακολουθίας Δυναμικής Όψης Λογικής Πεδίου
## Παραδείγματα λειτουργειών

Παρακάτω παρουσιάζεται διαγραμματικά το διάγραμμα ακολουθίας για το signIn ενός χρήστη.
Ακολουθούν τα sequence diagrams για την συνδεση, και ως παράδειγμα την ανάγνωση ιστορικού ανά terminal και την αποθήκευση νέου configuration.

![](Deliverables/R3/signin-seq.png)
![](Deliverables/R4/sign-in.png)

# Υλοποίηση Λογικής Πεδίου & Testing
![](Deliverables/R4/history-read.png)

Η υλοποίηση της λογικής πεδίου και το testing μπορούν να βρεθούν στο Android Studio Project που έχει αναρτηθεί.
![](Deliverables/R4/configuration-save.png)

# Coverage Reports

Το report για το coverage του κώδικα μπορεί να δημιουργηθεί μέσα από το Android Studio (Analyze -> Generate Coverage Report), αλλά συνοπτικά είχαμε 95% coverage στις κλάσεις, 99% coverage στις μεθόδους & 96% coverage στις γραμμές.
Το report για το coverage του κώδικα μπορεί να δημιουργηθεί μέσα από το Android Studio (Analyze -> Generate Coverage Report). Συνοπτικά με τις κλάσεις των activities και των fragments που απαιτούν Android tests είχαμε 46% συνολικό coverage, 50% στα services/presenters (λόγω μεθόδων Android) και 100% σε DAO και μοντέλο πεδίου.
8 changes: 6 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion 28
defaultConfig {
applicationId "gr.aueb.se.labadministration"
minSdkVersion 22
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
Expand All @@ -24,7 +24,11 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down

This file was deleted.

45 changes: 41 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gr.aueb.se.labadministration">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/app_icon"
android:supportsRtl="true"
android:theme="@style/AppTheme" />
</manifest>
android:theme="@style/AppTheme">

<service
android:name=".services.SignInService"
android:enabled="true"
android:exported="false" />
<service
android:name=".services.LabService"
android:enabled="true"
android:exported="false" />
<service
android:name=".services.HistoryService"
android:enabled="true"
android:exported="false" />
<service
android:name=".services.ConfigurationService"
android:enabled="true"
android:exported="false" />

<activity android:name=".activities.NewConfigurationActivity" />

<activity android:name=".activities.NewTerminalActivity" />

<activity
android:name=".activities.MainActivity"
android:label="@string/title_activity_main" />

<activity android:name=".activities.SignInActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-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
@@ -0,0 +1,91 @@
package gr.aueb.se.labadministration.activities;

import android.content.SharedPreferences;
import android.os.Bundle;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

import com.google.android.material.bottomnavigation.BottomNavigationView;

import gr.aueb.se.labadministration.R;
import gr.aueb.se.labadministration.fragments.ConfigurationFragment;
import gr.aueb.se.labadministration.fragments.HistoryFragment;
import gr.aueb.se.labadministration.fragments.LabFragment;

/**
* The main activity of the application, redirects to sign in activity
*/
public class MainActivity extends AppCompatActivity {

/**
* The bottom navigation bar, in case of admin the nav_history and nav_configuration options appear
*/
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
= item -> {
switch (item.getItemId()) {
case R.id.nav_history:
switchFragment(new HistoryFragment());
break;
case R.id.nav_labs:
switchFragment(new LabFragment());
break;
case R.id.nav_configuration:
switchFragment(new ConfigurationFragment());
break;
default: return false;
}
return true;
};

/**
* Fragment transaction method
* @param fragment to switch to
*/
public void switchFragment(Fragment fragment) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_view, fragment);
transaction.commit();
}

/**
* Default Android Methods
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
makeActionBar();
BottomNavigationView navView = findViewById(R.id.nav_view);
navView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);

if (getIntent().getBooleanExtra("configurations", false)) {
navView.setSelectedItemId(R.id.nav_configuration);
switchFragment(new ConfigurationFragment());
} else {
switchFragment(new LabFragment());
}

SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences("user", MODE_PRIVATE);
boolean administrator = sharedPreferences.getBoolean("administrator", false);

navView.getMenu().findItem(R.id.nav_history).setVisible(administrator);
navView.getMenu().findItem(R.id.nav_configuration).setVisible(administrator);
}

@Override
public void onBackPressed() {
getSupportFragmentManager().popBackStack();
}

// makes the action bar.
private void makeActionBar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setIcon(R.drawable.app_icon);
actionBar.setDisplayUseLogoEnabled(true);// display app_icon.
actionBar.setDisplayShowHomeEnabled(true);// display back button.
}

}
Loading