Giter Club home page Giter Club logo

unified-platform's Introduction

Unified Platform Project 📔

https://github.com/Pablito2020/Unified-Platform/actions/workflows/maven.yml/badge.svg https://github.com/Pablito2020/Unified-Platform/actions/workflows/javaformat.yml/badge.svg

Execute Tests 🧪

You can run the tests with IntelliJ, Maven or Eclipse.

IntelliJ:

Go to the src/test/java package, right click on it and select the “execute tests” option.

Eclipse:

Go to the root of the project, right click on it and select: “run as” and then “junit test”.

Maven:

Make sure that you have the Java Home Path exported. The JDK version should be 17 (in our case, we are using the OpenJDK one). In case you have to configure it on linux you can do:

$ export JAVA_HOME=/usr/lib/jvm/java-17-openjdk/

After that, go to the root of the project and execute:

$ mvn test

Contributing 💬

Before contributing, see the issues page for knowing which changes/improvements can be made to the project. After you’ve choosen the problem you want to fix, you have to assign yourself to the issue. After that, create a new branch with your name (for example: pablo), and commit your changes to it. When you have finished your work, you can nominate all the project members inside the issue and then, if everything goes fine, you will merge your branch with develop. If you want to see if some issue has already been talked inside the repository, you can go to the clossed issues tab.

Knowing issues 🛑

For know, the only “issue” we have is that github actions can’t execute the PDFDocumentTest class. This is because github actions runs on a server that doesn’t have a display server like Xorg installed, which is necessary for openning a pdf file.

For fixing this, we’ve created another maven configuration file just for github actions. This file ignores the PDFDocumentTest class and tests all the other classes. This is a hack that we would like to fix, but we hadn’t have more time.

unified-platform's People

Contributors

oscars35 avatar pablito2020 avatar rogerfontovatorres avatar

Watchers

 avatar  avatar  avatar

unified-platform's Issues

Ask on forum for more password restrictions

We can add more restrictions (and tests for the restrictions) inside the Password class.
Some restrictions can be:

  • Password can't be empty.
  • Password must have numbers, letters and one special character.
  • Password has to have a minimum length.

creationTime attribute question (PDFDocument class).

I'm trying to get the creationTime date of the PDF from the File attribute. I have been reading online about this and is quite difficult to get the creation date of a file in Linux. The question is, teacher wants us to get the date from the file or just enter the date on the constructor of the PDFDocument class? I think that she wants us to get it from the File but i have only been able to get it in milliseconds.

Unified Platform Implementation

Some questions about the implementation of UnifiedPlatform:

  • processSearcher, selectSS, selectCitizens and selectReports only print the state of the action? We have to implement the state dessign pattern for knowing which state has the application?
  • selectCerfiticationReport has to use a byte? We're having primitive obsession!!.
  • selectAuthMethod same as selectCertificationReport.
  • enterNIF-PINobt how can we break down the two input events? If we're having the two values as parameters!
  • enterCred: same as enterNIF-PINObt.

Improve QuotePeriodsCollection tests

Hey! A great task would be to improve the QuotePeriodsCollection tests. First, we've to discuss the questions on the issue #2 with the teacher and then do a more exhaustive testing on the data structure.
Some tests that I think we need to do are:

  1. Add some elements in natural order and check that the collection still in natural order.
  2. Add some elements in reverse order (bigger to smaller) and check that the collection still in natural order.
  3. What happens with null elements?
  4. What happens with objects with same references?
  5. What happens with objects with different references but same value? (maybe for this we'll have to see the equals method of QuotePeriod)
  6. Tests that if is a new instance of QuotePeriodsCollection, the collection is empty.

Since the QuotePeriodsCollection is a "wrapper" for a TreeSet, the TreeSet document from Java will become very handy for this tests (and for teach the user who does the tests how a TreeSet works).

Please, think about more tests that we can do for this data structure.

How do method enterCred() works?

I don't think it's clear how does enterCred() works.
Definition:
enterCred(Nif nif, Password passw): emula el uso del formulario donde el usuario
introduce las credenciales que lo acreditan en el sistema Cl@ve permanente.
Se puede desglosar en dos eventos de entrada: uno para el nif y otro para la
contraseña.
Si el usuario ha activado el método reforzado, automáticamente se generará un PIN,
para completar el segundo paso de identificación. Ello implica haber de introducir
ese PIN mediante el método enterPIN(pin) anterior.
Excepciones: las mismas mencionadas anteriormente (NifNotRegisteredException,
AnyMobileRegisteredException, ConnectException) y, adicionalmente,
NotValidCredException, para indicar que las credenciales proporcionadas no son
correctas.

To check if the credentials are correct, checkCred() method will be used.
checkCred() definition:
ckeckCredent(Nif nif, Password passw): retorna un byte que indicará diferentes
situaciones: 0 si el ciudadano no está registrado en el sistema Cl@ve permanente
con esas credenciales; 1 sí lo está y no tiene activado el método reforzado; y 2 si lo
está y utiliza el método reforzado.

My questions are:

  1. If the returning value is 0, will enterCred() continue with its execution seting the citizen's document attribute to the corresponding value or it will throw an exception?
  2. In case it has to throw an exception, which exception should it throw?

Fix QuotePeriod Date asserts on Constructor.

In the forum we were answered the question related to the issue #1, we have to add the following check on the constructor:

Que el nombre de dies no superi la data actual, comptant des de la Date rebuda com a paràmetre.

Implement double tests for case Cl@ve Pin.

Create a test file for the following methods:

  • EnterNIFPinobt
  • enterPIN
  • enterCred

Please, think that you will have to create some "mockup" objects that implements SS and CertificationAuthority. Some of this "mockup" objects have to be "error objects". For example, you can create a mockup object that always fail with the connection (raises a ConnectionException) and see how the class should fix or act in this case.

Quote Periods Collection

Doing the quote period collection class, I realized the following things we've to ask

  • Should the method: addQuotePeriod(QuotePeriod quote) throw a NullPointerException if we pass a null reference? (for now it does)
  • Should we add duplicated elements? (for now it doesn't)

Implement and Test case Cl@ve Pin Permanente

Please, implement the following methods:

  • enterCred method on UnifiedPlatform.
  • Testing, which involves:
    • Check enforced method (metodo reforzado)
    • Check simple method (metodo simple)
    • What happens to NotRegistred? (Ask to the forum)?.

Please, for the testing see the oscar branch, since it has all the test interfaces (and has the implementation of Cl@ve Pin Tests, which are similar).

Delete NULL checking from LaboralLifeDoc and MemberAccreditationDoc (and test classes!)

As the teacher explained on the forum, we don't have to check if the instances are null, since they were given to us by the SecuritySocial instance (which we can think that will never give a null reference).
So, we have to:

  1. Delete Null checking on LaboralLifeDoc
  2. Delete Null checking tests on LaboralLifeDocTest
  3. Delete Null checking on MemberAccreditationDoc
  4. Delete Null checking tests on MemberAccreditationDocTest.

Fix Unified Platform TODO's

  • enterKeyWords(): no need to do anything
  • enterPin(): set the appropiate document depending on the chosen procedure
  • enterCred(): Check if reinforced method has been activated.

PDFDocument class questions.

  1. We have to ask about the IOException of the moveDoc method.
  2. In the case of having a new constructor, ask about checking if file has already been created.
  3. Ask if a file getter is needed

I finished tests for the class PDFDocument. I have just to say that moveDoc test moves the file into another location and then moves the file again to default location just to make sure openDoc test can open the file correctly.

Quote Period

Doing the quote period class, I realized the following things we've to ask

  • Can date be null?
  • number of days has to be equal or greatter than 1?
  • The string format can be something like this?
  Quote{
          initial day: day, 
          number of days: days
   }

Implement and test Digital Certificate Case

Things to be done:

  • Create an enumeration with all the certificates that are available.
  • Has selectCertificate print all the different certificates?
  • Implement selectCertificate on UnifiedPlatform
  • Implement the enterPassword method on UnifiedPlatform
  • Implement DecryptData on UnifiedPlatform.
  • Test the UnifiedPlatform methods injecting the CertificationAuthority and Encryptor and Decryptor instances.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.