Skip to content
Snippets Groups Projects
Commit e26618e3 authored by Falucho's avatar Falucho
Browse files

Merge remote-tracking branch 'origin/master'

parents c3289f0e 4eda151f
No related branches found
No related tags found
No related merge requests found
package uy.edu.fing.tse.central.db.dao.category;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class CategoryDAOBeanTest {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void create() {
}
@Test
public void update() {
}
@Test
public void remove() {
}
@Test
public void find() {
}
@Test
public void find1() {
}
@Test
public void findAll() {
}
}
\ No newline at end of file
......@@ -2,9 +2,11 @@ package uy.edu.fing.tse.central.db.mapper;
import org.junit.Assert;
import org.junit.Test;
import uy.edu.fing.tse.central.db.entity.Periferico;
import uy.edu.fing.tse.central.db.entity.*;
import uy.edu.fing.tse.dto.*;
import java.util.Date;
public class MyMapperTest {
@Test
......@@ -71,4 +73,88 @@ public class MyMapperTest {
final var convert2 = MyMapper.INSTANCE.convert(convert);
Assert.assertNotNull(convert2);
}
@Test
public void convert3() {
final var mecanismo = new MecanismoInterno();
mecanismo.setEneable(true);
mecanismo.setId(1234L);
mecanismo.setName("mecanismo");
final var convert = MyMapper.INSTANCE.convert(mecanismo);
Assert.assertNotNull(convert);
final var convert2 = MyMapper.INSTANCE.convert(convert);
Assert.assertNotNull(convert2);
}
@Test
public void convert4() {
final Usuario usuario = null;
final var convert = MyMapper.INSTANCE.convert(usuario);
Assert.assertNull(convert);
final var convert2 = MyMapper.INSTANCE.convert(convert);
Assert.assertNull(convert2);
}
@Test
public void convert5() {
final var cosa = new VerificacionMecanismo();
Short sh = 3;
cosa.setGrade(sh);
Hecho fact = new Hecho();
Estado st = new Estado();
st.setId(123L);
st.setValue("Nuevo");
fact.setActualState(st);
fact.setCategory(new Categoria());
fact.setDescription("es una gran fruta");
fact.setTitle("LA fruta");
fact.setScore(new Calificacion());
cosa.setFact(fact);
cosa.setId(1234L);
cosa.setJustification("porque yo lo valgo");
cosa.setRegisterDate(new Date());
final var convert = MyMapper.INSTANCE.convert(cosa);
Assert.assertNotNull(convert);
final var convert2 = MyMapper.INSTANCE.convert(convert);
Assert.assertNotNull(convert2);
}
@Test
public void convert6() {
final var cosa = new VerificacionChecker();
//cosas auxiliares
Hecho fact = new Hecho();
Estado st = new Estado();
st.setId(123L);
st.setValue("Nuevo");
fact.setActualState(st);
fact.setCategory(new Categoria());
fact.setDescription("es una gran fruta");
fact.setTitle("LA fruta");
fact.setScore(new Calificacion());
UsuarioBO userBO = new UsuarioBO();
userBO.setId(1234L);
Rol rol = new Rol();
rol.setId(12L);
rol.setName("Mi rol");
userBO.setRole(rol);
//set cosas
cosa.setFact(fact);
cosa.setId(1234L);
cosa.setJustification("porque yo lo valgo");
cosa.setChecker(userBO);
cosa.setFact(fact);
final var convert = MyMapper.INSTANCE.convert(cosa);
Assert.assertNotNull(convert);
final var convert2 = MyMapper.INSTANCE.convert(convert);
Assert.assertNotNull(convert2);
}
}
\ No newline at end of file
package uy.edu.fing.tse.central.business;
import org.junit.Assert;
import org.junit.Test;
import uy.edu.fing.tse.dto.Category;
import uy.edu.fing.tse.dto.Peripherical;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
public class BusinessBeanTest {
@Test
public void altaPeriferico() {
Peripherical p = new Peripherical();
List<Category> categorias = new ArrayList<>();
Category cat = new Category();
cat.setDescription("desct");
cat.setId(12L);
cat.setName("name");
categorias.add(cat);
p.setCategories(categorias);
BusinessBean bb = new BusinessBean();
bb.altaPeriferico(p);
var perifericos = bb.listarPerifericos();
Assert.assertTrue(perifericos.contains(p));
}
/*@Test
public void updateUsuario() {
}
@Test
public void updateMecanismo() {
}
@Test
public void updatePeriferico() {
}
@Test
public void altaVerificacionMecanismo() {
}
@Test
public void altaHecho() {
}
@Test
public void altaEstado() {
}
@Test
public void altaRol() {
}
@Test
public void altaCalificacion() {
}
@Test
public void listarHechos() {
}
@Test
public void listarUsuarios() {
}
@Test
public void listarRoles() {
}
@Test
public void listarEstados() {
}
@Test
public void altaUsuario() {
}
@Test
public void removeUser() {
}
@Test
public void buscarUsuario() {
}
@Test
public void buscarHecho() {
}
@Test
public void altaCategoria() {
}
@Test
public void altaMecanismoInterno() {
}
@Test
public void listarPerifericos() {
}
@Test
public void listarMecanismosInternos() {
}
@Test
public void buscarHechos() {
}
@Test
public void subscribirse() {
}*/
}
\ No newline at end of file
......@@ -31,6 +31,10 @@
<version.surefire.plugin>2.22.2</version.surefire.plugin>
<version.war.plugin>3.2.3</version.war.plugin>
<sonar.host.url>
http://nube.faller.com.uy:9000
</sonar.host.url>
<org.mapstruct.version>1.3.0.Final</org.mapstruct.version>
</properties>
......@@ -241,13 +245,16 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment