Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b1bdd0d
Primeiros testes e configuração local
Jul 9, 2025
0e10cb5
add classe bebida inicial
guibree2-IN Jul 10, 2025
0f5ab5d
criando classe teste bebida
guibree2-IN Jul 11, 2025
e80443b
subindo classe de teste vazia para teste de commit
gabrielripper1 Jul 12, 2025
bab4f63
Mock de Cadastro de Cliente
Jul 12, 2025
aaa76d4
Mock de Cadastro de Cliente
Jul 12, 2025
015046b
Salvando arquivos antes do merge
Jul 12, 2025
66f5a8d
Mock de Cadastro de Cliente
Jul 12, 2025
8eefa96
Mock de Cadastro de Cliente
Jul 12, 2025
7acfd5a
Refatora Remover ingredientes
Jul 12, 2025
d44ac50
subindo a classe de teste do validador cookie e deletando a classe de…
gabrielripper1 Jul 12, 2025
ee137dc
Testes remover ingredientes
Jul 12, 2025
573a95f
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
gabrielripper1 Jul 12, 2025
392ec93
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
DenielR Jul 12, 2025
fc787c3
+ refatoração e + testes de ingredientes
DenielR Jul 12, 2025
121e336
Testes de integração ingredientes + adição de comentários
DenielR Jul 12, 2025
a762917
Teste de sistema + organizar pastas
DenielR Jul 13, 2025
389c8b9
add classe DaoBebidaTest
guibree2-IN Jul 13, 2025
2f49162
add mock da classe de teste daobebida
guibree2-IN Jul 13, 2025
053cbb4
add testes da classe de teste daobebida
guibree2-IN Jul 13, 2025
9d39f3f
mudando para a pasta certa teste de daobebida
guibree2-IN Jul 13, 2025
fdcfa81
subindo o teste de integracao para o fluxo de compra
gabrielripper1 Jul 13, 2025
308fcf6
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
gabrielripper1 Jul 13, 2025
b7fc170
Testes de integração
Jul 13, 2025
4b10506
Merge branch 'testes/Cliente'
Jul 13, 2025
74b6de0
subindo o teste utilizando selenium do caso de teste Login de Admin
gabrielripper1 Jul 14, 2025
0472fe7
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
gabrielripper1 Jul 14, 2025
dabfb22
mudando pra pasta certa teste unitário e add teste logout servlet e t…
guibree2-IN Jul 14, 2025
04066b1
Adicionando ReadMe para professora
guibree2-IN Jul 14, 2025
3ff2e1f
Correção de link
guibree2-IN Jul 14, 2025
e5f3f00
Testes de integração
Jul 14, 2025
d9f2b9e
tirando daobebidatest e logando em salvarbebidasistematest
guibree2-IN Jul 14, 2025
5d912fd
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
guibree2-IN Jul 14, 2025
e964186
ADD EncryptadorMD5Test em unitarios
guibree2-IN Jul 14, 2025
d5f0aab
refazendo para refletir hash esperado
guibree2-IN Jul 14, 2025
02f7088
Teste de selinum para cadastro de cliente
Jul 14, 2025
a228c99
Merge remote-tracking branch 'origin/master'
Jul 14, 2025
44c8f0c
add link da apresentação
guibree2-IN Jul 14, 2025
297da42
corrigindo ID de login e senha
guibree2-IN Jul 14, 2025
f255344
Merge remote-tracking branch 'origin/master'
Jul 14, 2025
7828006
Merge remote-tracking branch 'origin/master'
Jul 14, 2025
a535a87
tentando refazer sem erros
guibree2-IN Jul 14, 2025
19b875b
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
guibree2-IN Jul 14, 2025
68a268a
refazendo teste bebida
guibree2-IN Jul 14, 2025
a34fa2d
melhorando classe encriptadora para lançar exceção em erros
guibree2-IN Jul 14, 2025
9d04ee3
subindo melhorias no código de integração de fluxo de compra, utiliza…
gabrielripper1 Jul 14, 2025
e58025d
aumentando readme para mais explicações
guibree2-IN Jul 14, 2025
82fc1f4
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
gabrielripper1 Jul 14, 2025
ade4573
push final readme + tobe enkript
guibree2-IN Jul 14, 2025
a5fe969
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
guibree2-IN Jul 14, 2025
2ddcfd6
subindo a modificação no pom.xml e o novo dockerfile para rodar o tes…
gabrielripper1 Jul 14, 2025
fd76de0
Merge branch 'master' of https://github.com/DanFP00/APS-04-Lanchonete…
gabrielripper1 Jul 14, 2025
093d3f6
Correção do Readme e correção de testes para funcionar com o docker
Jul 16, 2025
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM maven:3.8.4-openjdk-8 AS build
FROM maven:3.8.4-openjdk-17 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
COPY web ./web
RUN mvn clean package

FROM tomcat:8.5-jre8
FROM tomcat:8.5-jdk17-temurin

# Instala o unzip para inspeção do .war
RUN apt-get update && apt-get install -y unzip

# Copia o .war gerado pelo Maven
COPY --from=build /app/target/*.war /usr/local/tomcat/webapps/ROOT.war
COPY context.xml /usr/local/tomcat/conf/
EXPOSE 8080
CMD ["catalina.sh", "run"]
EXPOSE 8080 5005
CMD ["catalina.sh", "run"]
25 changes: 25 additions & 0 deletions Dockerfile.mutation
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Dockerfile para executar testes de mutação
FROM maven:3.8.6-openjdk-8

WORKDIR /app

COPY pom.xml ./
COPY src/ ./src/
COPY web/ ./web/
COPY libraries/ ./libraries/

RUN mvn dependency:go-offline -B

RUN mvn clean compile

# excluir partes que usam selenium(tava bugando)
RUN rm -rf src/test/java/Testes/Sistema*

# removendo CRUD
RUN rm -f src/test/java/DAO/ClienteControllerTest.java
RUN rm -f src/test/java/DAO/DaoClienteTest.java
RUN rm -rf src/test/java/DAO/TestesIngredientes*

RUN mvn test-compile

CMD ["mvn", "org.pitest:pitest-maven:mutationCoverage", "-DmutationThreshold=0", "-DskipTests=false", "-DtargetClasses=Controllers.*,DAO.*,Helpers.*,Model.*", "-DoutputFormats=HTML,XML"]
5 changes: 5 additions & 0 deletions Dockerfile.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM maven:3.8.4-openjdk-8

RUN apt-get update && apt-get install -y postgresql-client

WORKDIR /app
57 changes: 57 additions & 0 deletions README_QA_2025_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Qualidade e Teste de Software 2025.1

# Links
ISO 25010: https://docs.google.com/document/d/150YBd9KHCjxVCDo0uLmm2s0dKvBKr9marKX2-KIz8o0/edit?tab=t.0

Apresentação: www.canva.com/design/DAGtFCWyR3o/lcjF80iUKg-F6QW3eEDBXg/edit?utm_content=DAGtFCWyR3o&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Repositório Original do grupo: https://github.com/DanFP00/APS-04-Lanchonete-Online-em-Java


#Observações

- A estrutura de pastas dos testes, foi pessoal de cada integrante do grupo, segue onde achar todos os testes:

test
└── java
├── DAO
│ ├── TestesIngredientes
│ │ ├── IngredienteIntegracaoTest.java
│ │ ├── IngredientesMockitoTest.java
│ ├── ClienteControllerTest.java
│ ├── DaoClienteTest.java
├── Helpers
│ └── ValidadorCookieTest.java
├── Integracao
│ ├── CadastroIntegrationTest.java
│ ├── DatabaseConnectionTest.java
│ ├── FluxoCompraIntegrationTest.java
│ └── LoginIntegrationTest.java
├── integration
│ └── FluxoCompraIntegrationTest.java
├── Testes
│ ├── Integração
│ │ ├── IngredienteBdTest.java
│ │ └── LogoutServletTest.java
├── Sistema
│ ├── CadastroClienteTest.java
│ ├── CadastroIngredienteTest.java
│ ├── LoginTest.java
│ └── SalvarBebidaSistemaTest.java
└── Unitários
├── EncryptadorMD5Test.java
└── IngredientesMockitoTest.java



- Fotos das analises do Pitest estõa na apresentação


Foi feita uma pequena alteração numa classe para lançar exceção ao invés de Null em caso de erro.
Essa classe se encontra em: src\java\Helpers\EncryptadorMD5_to_be.java
7 changes: 7 additions & 0 deletions ReadMe_QualidadeETeste.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ISO 25010: https://docs.google.com/document/d/150YBd9KHCjxVCDo0uLmm2s0dKvBKr9marKX2-KIz8o0/edit?tab=t.0

Apresentação: www.canva.com/design/DAGtFCWyR3o/lcjF80iUKg-F6QW3eEDBXg/edit?utm_content=DAGtFCWyR3o&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton


Foi feita uma pequena alteração numa classe para lançar exceção ao invés de Null em caso de erro.
Essa classe se encontra em: src\java\Helpers\EncryptadorMD5_to_be.java
19 changes: 18 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,21 @@ services:
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/lanchonete
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_DATASOURCE_PASSWORD=postgres

tests:
image: maven:3.8.4-openjdk-8
working_dir: /app
volumes:
- ./:/app
depends_on:
db:
condition: service_healthy
# Instala o psql e roda o script de testes
command: /bin/bash -c "apt-get update && apt-get install -y postgresql-client && ./scripts/run_tests.sh"
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/lanchonete
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
ports:
- "5005:5005"
73 changes: 73 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,33 @@
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>

<!-- Mockito Core -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.11.13</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.12.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -64,6 +91,11 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
Expand Down Expand Up @@ -108,6 +140,47 @@
</execution>
</executions>
</plugin>
<!-- Plugin PITest para teste de mutação -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.15.8</version>
<configuration>
<targetClasses>
<param>Controllers.*</param>
<param>DAO.*</param>
<param>Helpers.*</param>
<param>Model.*</param>
</targetClasses>
<targetTests>
<param>*Test</param>
</targetTests>
<threads>4</threads>
<outputFormats>
<outputFormat>HTML</outputFormat>
<outputFormat>XML</outputFormat>
</outputFormats>
<timestampedReports>false</timestampedReports>
<mutators>
<mutator>DEFAULTS</mutator>
</mutators>
<jvmArgs>
<jvmArg>-Xmx2048m</jvmArg>
</jvmArgs>
<failWhenNoMutations>false</failWhenNoMutations>
<skipFailingTests>true</skipFailingTests>
<mutationThreshold>0</mutationThreshold>
<coverageThreshold>0</coverageThreshold>
<includeJarFiles>true</includeJarFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
13 changes: 13 additions & 0 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

echo "Esperando o banco de dados ficar pronto..."
until pg_isready -h db -p 5432 -U postgres; do
>&2 echo "Banco de dados não está pronto ainda..."
sleep 2
done

echo "Banco de dados está pronto. Rodando testes em modo DEBUG..."

# Forçando debug manualmente com suspend=y para aguardar conexão do IntelliJ
mvn test -DforkCount=0 -Dmaven.surefire.argLine="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"
4 changes: 2 additions & 2 deletions src/java/Controllers/cadastro.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re

//E Para finalizar, salva no Banco usando o DAO deles
cliente.setEndereco(endereco);

DaoCliente clienteDAO = new DaoCliente();
clienteDAO.salvar(cliente);

Expand Down Expand Up @@ -119,7 +119,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
Expand Down
Loading