Commit c86976c3 by Rafael Ortega Chica

Merge branch 'Rafael'

parents ebccaa90 1ef5f661
......@@ -31,3 +31,4 @@ build/
### VS Code ###
.vscode/
/nbproject/
\ No newline at end of file
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
No preview for this file type
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
......@@ -28,15 +28,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
......
{
"1":{
"nombre":"CL Andalucía-Extremadura",
"localización":"Sevilla",
"provincias":[
"Almería",
"Cádiz",
"Córdoba",
"Granada",
"Huelva",
"Jaén",
"Málaga",
"Sevilla",
"Badajoz",
"Cáceres",
"Melilla",
"Ceuta"
],
"conexiones":[
2,
3
]
},
"2":{
"nombre":"CL Castilla La Mancha",
"localización":"Toledo",
"provincias":[
"Albacete",
"Ciudad Real",
"Cuenca",
"Guadalajara",
"Toledo"
],
"conexiones":[
1,
9,
3
]
},
"3":{
"nombre":"CL Levante",
"localización":"Valencia",
"provincias":[
"Castellón",
"Valencia",
"Alicante",
"Murcia",
"Islas Baleares"
],
"conexiones":[
2,
1,
5
]
},
"4":{
"nombre":"CL Castilla León-Rioja",
"localización":"Valladolid",
"provincias":[
"León",
"Zamora",
"Salamanca",
"Palencia",
"Valladolid",
"Avila",
"Burgos",
"Segovia",
"Soria",
"La Rioja"
],
"conexiones":[
9,
7,
8,
6
]
},
"5":{
"nombre":"CL Cataluña",
"localización":"Barcelona",
"provincias":[
"Lleida",
"Girona",
"Barcelona",
"Tarragona"
],
"conexiones":[
3,
6
]
},
"6":{
"nombre":"CL Aragón-Navarra",
"localización":"Zaragoza",
"provincias":[
"Zaragoza",
"Huesca",
"Navarra",
"Teruel"
],
"conexiones":[
9,
5,
7,
4
]
},
"7":{
"nombre":"CL Pais Vasco-Cantabria",
"localización":"Vitoria",
"provincias":[
"Vizcaya",
"Alava",
"San Sebastián",
"Cantabria"
],
"conexiones":[
6,
4,
8
]
},
"8":{
"nombre":"CL Galicia-Asturias",
"localización":"Orense",
"provincias":[
"La Coruña",
"Lugo",
"Orense",
"Pontevedra",
"Asturias"
],
"conexiones":[
7,
4
]
},
"9":{
"nombre":"CL Madrid",
"localización":"Madrid",
"provincias":[
"Madrid"
],
"conexiones":[
6,
4,
2,
10
]
},
"10":{
"nombre":"CL Canarias",
"localización":"Santa Cruz de Tenerife",
"provincias":[
"Santa Cruz de Tenerife",
"Las Palmas"
],
"conexiones":[
9
]
}
}
\ No newline at end of file
{
"1":{
"nombre":"CL Andalucia-Extremadura",
"localizacion":"Sevilla",
"provincias":[
"Almeria",
"Cadiz",
"Cordoba",
"Granada",
"Huelva",
"Jaen",
"Malaga",
"Sevilla",
"Badajoz",
"Caceres",
"Melilla",
"Ceuta"
],
"conexiones":[
2,
3
]
},
"2":{
"nombre":"CL Castilla La Mancha",
"localizacion":"Toledo",
"provincias":[
"Albacete",
"Ciudad Real",
"Cuenca",
"Guadalajara",
"Toledo"
],
"conexiones":[
1,
9,
3
]
},
"3":{
"nombre":"CL Levante",
"localizacion":"Valencia",
"provincias":[
"Castellon",
"Valencia",
"Alicante",
"Murcia",
"Islas Baleares"
],
"conexiones":[
2,
1,
5
]
},
"4":{
"nombre":"CL Castilla Leon-Rioja",
"localizacion":"Valladolid",
"provincias":[
"Leon",
"Zamora",
"Salamanca",
"Palencia",
"Valladolid",
"Avila",
"Burgos",
"Segovia",
"Soria",
"La Rioja"
],
"conexiones":[
9,
7,
8,
6
]
},
"5":{
"nombre":"CL Cataluña",
"localizacion":"Barcelona",
"provincias":[
"Lleida",
"Girona",
"Barcelona",
"Tarragona"
],
"conexiones":[
3,
6
]
},
"6":{
"nombre":"CL Aragon-Navarra",
"localizacion":"Zaragoza",
"provincias":[
"Zaragoza",
"Huesca",
"Navarra",
"Teruel"
],
"conexiones":[
9,
5,
7,
4
]
},
"7":{
"nombre":"CL Pais Vasco-Cantabria",
"localizacion":"Vitoria",
"provincias":[
"Vizcaya",
"Alava",
"San Sebastian",
"Cantabria"
],
"conexiones":[
6,
4,
8
]
},
"8":{
"nombre":"CL Galicia-Asturias",
"localizacion":"Orense",
"provincias":[
"La Coruña",
"Lugo",
"Orense",
"Pontevedra",
"Asturias"
],
"conexiones":[
7,
4
]
},
"9":{
"nombre":"CL Madrid",
"localizacion":"Madrid",
"provincias":[
"Madrid"
],
"conexiones":[
6,
4,
2,
10
]
},
"10":{
"nombre":"CL Canarias",
"localizacion":"Santa Cruz de Tenerife",
"provincias":[
"Santa Cruz de Tenerife",
"Las Palmas"
],
"conexiones":[
9
]
}
}
\ No newline at end of file
......@@ -4,26 +4,33 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import es.ujaen.dae.beans.ServicioUjaPackImpl;
import es.ujaen.dae.entidades.Envio;
import es.ujaen.dae.entidades.PuntodeControl;
import es.ujaen.dae.entidades.TipoPunto;
import static es.ujaen.dae.entidades.TipoPunto.CentroLogistico;
import static es.ujaen.dae.entidades.TipoPunto.Oficina;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@SpringBootApplication(scanBasePackages = "es.ujaen.dae.beans")
public class UjapackApplication {
public static void main(String[] args){
SpringApplication.run(UjapackApplication.class, args);
ArrayList<PuntodeControl> puntosdecontrol= new ArrayList<>();
HashMap<Integer,PuntodeControl> puntosdecontrol= new HashMap<>();
int idPr=11; //Id para las provincias, se usa para darle un identificador a cada una de las oficinas.
String fichero="";
try(BufferedReader br=new BufferedReader(new FileReader("redujapack.json"))){
try(BufferedReader br=new BufferedReader(new FileReader("redujapackPr.json"))){
String linea;
while((linea=br.readLine())!=null){
fichero+=linea;
......@@ -35,32 +42,64 @@ public class UjapackApplication {
}
JsonObject obj=new Gson().fromJson(fichero, JsonObject.class);
Set<String> centrosLCla=obj.keySet();
Set<String> centrosLCla=obj.keySet(); //Se guardan las claves de los centros logísticos.
for(String centro : centrosLCla){
ArrayList<String> provincias=new ArrayList<>();
ArrayList<Integer> conexiones=new ArrayList<>();
JsonObject centroJson=obj.getAsJsonObject(centro);
//int id=Integer.parseInt(centro);
int id=Integer.parseInt(centro); //Id para especidificamente los centros logísticos.
String nombre=centroJson.get("nombre").getAsString();
String localizacion=centroJson.get("localización").getAsString();
String localizacion=centroJson.get("localizacion").getAsString();
JsonArray provinciasArr=centroJson.getAsJsonArray("provincias");
for(JsonElement prov : provinciasArr){
provincias.add(prov.getAsString());
PuntodeControl pc2 = new PuntodeControl(prov.getAsString(),prov.getAsString(),Oficina,nombre);
puntosdecontrol.put(idPr,pc2);
pc2.setConexiones(conexiones);
idPr++;
}
JsonArray conexionesArr=centroJson.getAsJsonArray("conexiones");
for(JsonElement con : conexionesArr){
conexiones.add(con.getAsInt());
}
PuntodeControl cl=new PuntodeControl(nombre, localizacion, provincias, conexiones);
puntosdecontrol.add(cl);
System.out.println(cl.toString());
PuntodeControl pc=new PuntodeControl(nombre, localizacion,CentroLogistico,nombre);
pc.setConexiones(conexiones);
pc.setProvincias(provincias);
puntosdecontrol.put(id,pc); /**Aqui es id y no idPr porque aqui se añaden especificamente los centros logisticos, no oficinas
por lo que se toma dicho id. */
}
ServicioUjaPackImpl servi = new ServicioUjaPackImpl();
servi.crearEnvio("Juan", "Maria", "Jaen", "Jaen", 0, 0, 0, 0);
//Test manuales
/*
//Prueba del metodo Calcular ruta y calcular importe
Envio e = new Envio("Jose","Maria","Castellon","Islas Baleares",0.5f,20.4f,20.4f,20.4f);
ArrayList<PuntodeControl> j = new ArrayList<>();
j = e.calcularRuta(puntosdecontrol,e);
System.out.println(j.size());
for(int i=0; i<j.size(); i++){
System.out.println(j.get(i));
}
float v = 0;
v = e.calcularImporte(e);
System.out.println(v);
e.Pasos(e);
//Fin de prueba del metodo calcular ruta. Esto debe pasarse a un test propio
*/
}
}
......@@ -4,13 +4,25 @@
* and open the template in the editor.
*/
package es.ujaen.dae.beans;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import es.ujaen.dae.entidades.Envio;
import es.ujaen.dae.entidades.HoraEnvios;
import es.ujaen.dae.entidades.PuntodeControl;
import es.ujaen.dae.entidades.TipoPunto;
import static es.ujaen.dae.entidades.TipoPunto.CentroLogistico;
import static es.ujaen.dae.entidades.TipoPunto.Oficina;
import es.ujaen.dae.interfaces.ServicioUjaPack;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import org.springframework.stereotype.Component;
......@@ -24,6 +36,7 @@ public class ServicioUjaPackImpl implements ServicioUjaPack{
private String oficinaOrigen; //Creo que estos dos atributos son innecesarios
private String oficinaDestino; //Creo que estos dos atributos son innecesarios
private ArrayList<Envio> envios;
private HashMap<Integer,PuntodeControl> json;
......@@ -35,7 +48,59 @@ public class ServicioUjaPackImpl implements ServicioUjaPack{
* @brief constructor de la clase ServicioUjaPack el cual inicializara la lista de Envios del sistema
*/
public ServicioUjaPackImpl(){
this.envios=new ArrayList<Envio>();
this.envios=new ArrayList<>();
this.json=new HashMap<>();
}
private HashMap<Integer,PuntodeControl> lecturaJson(){
HashMap<Integer,PuntodeControl> puntosdecontrol= new HashMap<>();
int idPr=11; //Id para las provincias, se usa para darle un identificador a cada una de las oficinas.
String fichero="";
try(BufferedReader br=new BufferedReader(new FileReader("redujapackPr.json"))){
String linea;
while((linea=br.readLine())!=null){
fichero+=linea;
}
} catch(FileNotFoundException e){
System.out.println(e.getMessage());
} catch(IOException e){
System.out.println(e.getMessage());
}
JsonObject obj=new Gson().fromJson(fichero, JsonObject.class);
Set<String> centrosLCla=obj.keySet(); //Se guardan las claves de los centros logísticos.
for(String centro : centrosLCla){
ArrayList<String> provincias=new ArrayList<>();
ArrayList<Integer> conexiones=new ArrayList<>();
JsonObject centroJson=obj.getAsJsonObject(centro);
int id=Integer.parseInt(centro); //Id para especidificamente los centros logísticos.
String nombre=centroJson.get("nombre").getAsString();
String localizacion=centroJson.get("localizacion").getAsString();
JsonArray provinciasArr=centroJson.getAsJsonArray("provincias");
for(JsonElement prov : provinciasArr){
provincias.add(prov.getAsString());
PuntodeControl pc2 = new PuntodeControl(prov.getAsString(),prov.getAsString(),Oficina,nombre);
puntosdecontrol.put(idPr,pc2);
pc2.setConexiones(conexiones);
idPr++;
}
JsonArray conexionesArr=centroJson.getAsJsonArray("conexiones");
for(JsonElement con : conexionesArr){
conexiones.add(con.getAsInt());
}
PuntodeControl pc=new PuntodeControl(nombre, localizacion,CentroLogistico,nombre);
pc.setConexiones(conexiones);
pc.setProvincias(provincias);
puntosdecontrol.put(id,pc);
}
return puntosdecontrol;
}
......@@ -101,7 +166,10 @@ public class ServicioUjaPackImpl implements ServicioUjaPack{
*/
@Override
public Envio crearEnvio(String remitente, String destinatario, String origen, String destino, float peso, float alto, float largo, float ancho){
return new Envio(remitente,destinatario,origen,destino,peso,alto,largo,ancho);
Envio e = new Envio(remitente,destinatario,origen,destino,peso,alto,largo,ancho);
e.calcularRuta(json, e);
e.calcularImporte(e);
return e;
}
......@@ -109,6 +177,7 @@ public class ServicioUjaPackImpl implements ServicioUjaPack{
/**
* @brief Funcion que nos indica el estado actual de un envio concreto
* @param e un envio
......@@ -122,6 +191,13 @@ public class ServicioUjaPackImpl implements ServicioUjaPack{
}
}
}
/**
* @return the json
*/
public HashMap<Integer,PuntodeControl> getJson() {
return json;
}
......
......@@ -7,6 +7,8 @@ package es.ujaen.dae.entidades;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import es.ujaen.dae.Ujapack.UjapackApplication;
/**
*
......@@ -31,10 +33,74 @@ public class Envio {
this.direccionDestino=direccionDestino;
this.direccionOrigen=direccionOrigen;
this.fechaEntegra= LocalDate.now();
this.listadoPuntos=new ArrayList<PuntodeControl>();
this.listadoPuntos=new ArrayList<>();
}
public void calcularImporte(){} //cambiar void por float
public float calcularImporte(Envio e){
float importe = 0;
importe = (e.getPeso()*e.getAlto()*e.getAncho()*e.getLargo()*((e.getListadoPuntos().size())+1)/1000);
return importe;
}
public void Pasos(Envio e){
if(e.getListadoPuntos().size() == 1){
e.setEstado('R');
System.out.println("El paquete esta en " + e.getEstado());
e.setEstado('E');
System.out.println("El paquete esta en " + e.getEstado());
}else{
if(e.getListadoPuntos().size() == 3){
e.setEstado('T');
for(int i=0; i<e.getListadoPuntos().size(); i++){
System.out.println("El paquete esta en " + e.getEstado() + " en la provincia " + e.getListadoPuntos().get(i).getProvincia());
}
e.setEstado('R');
System.out.println("El paquete esta en " + e.getEstado());
e.setEstado('E');
System.out.println("El paquete esta en " + e.getEstado());
}
}
}
//Hecho solamente el caso donde envias y recibes dentro de la misma provincia
public ArrayList<PuntodeControl> calcularRuta(HashMap<Integer,PuntodeControl> cl, Envio e){
boolean a=false;
boolean b=false;
boolean c=false;
if(e.getDireccionOrigen().equals(e.getDireccionDestino())){
for(int i=1; i<cl.size(); i++){
if(cl.get(i).getProvincia().equals(e.getDireccionDestino())){
listadoPuntos.add(cl.get(i));
break;
}
}
}else{
for(int i=1; i<cl.size(); i++){
if(cl.get(i).getProvincia().equals(e.getDireccionOrigen()) && a == false){
listadoPuntos.add(cl.get(i));
a=true;
for(int z=1; z<cl.size(); z++){
if(cl.get(i).getCentro().equals(cl.get(z).getCentro()) && c == false){
listadoPuntos.add(cl.get(z));
c=true;
}
}
}
if(cl.get(i).getProvincia().equals(e.getDireccionDestino()) && b == false){
listadoPuntos.add(cl.get(i));
b=true;
}
}
}
return listadoPuntos;
}
......
......@@ -13,21 +13,26 @@ import java.util.ArrayList;
public class PuntodeControl {
private String nombre,provincia; //Provincia es la localización donde está
private String nombre,provincia,centro; //Provincia es la localización donde está
private int id;
private TipoPunto tipo;
private ArrayList<String> provincias;
private ArrayList<Integer> conexiones;
public PuntodeControl(String nombre, String provincia,ArrayList<String> provincias, ArrayList<Integer> conexiones){ //AÑADIR EL ENUM AL CONSTRUCTOR DEL PUNTO DE CONTROL
public PuntodeControl(String nombre, String provincia, TipoPunto t, String centro){ //AÑADIR EL ENUM AL CONSTRUCTOR DEL PUNTO DE CONTROL
this.id = id;
this.nombre=nombre;
this.provincia=provincia;
this.provincias=provincias;
this.conexiones=conexiones;
tipo = t;
this.conexiones = new ArrayList<>();
this.provincias = new ArrayList<>();
this.centro=centro;
};
/**
* @return the provincia
......@@ -70,5 +75,52 @@ public class PuntodeControl {
public void setTipo(TipoPunto tipo) {
this.tipo = tipo;
}
/**
* @return the provincias
*/
public ArrayList<String> getProvincias() {
return provincias;
}
/**
* @param provincias the provincias to set
*/
public void setProvincias(ArrayList<String> provincias) {
this.provincias = provincias;
}
/**
* @return the conexiones
*/
public ArrayList<Integer> getConexiones() {
return conexiones;
}
/**
* @param conexiones the conexiones to set
*/
public void setConexiones(ArrayList<Integer> conexiones) {
this.conexiones = conexiones;
}
@Override
public String toString(){
return nombre;
}
/**
* @return the centro
*/
public String getCentro() {
return centro;
}
/**
* @param centro the centro to set
*/
public void setCentro(String centro) {
this.centro = centro;
}
}
......@@ -8,6 +8,7 @@ package es.ujaen.dae.interfaces;
import es.ujaen.dae.entidades.Envio;
import es.ujaen.dae.entidades.PuntodeControl;
import java.util.ArrayList;
import java.util.HashMap;
/**
*
......@@ -26,4 +27,5 @@ public interface ServicioUjaPack {
public void notificar(int id);
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package es.ujaen.dae.Ujapack.beans;
import es.ujaen.dae.Ujapack.UjapackApplication;
import es.ujaen.dae.beans.ServicioUjaPackImpl;
import java.util.function.BooleanSupplier;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(classes={UjapackApplication.class})
public class ServicioUjapackImplIntegrationTest {
@Autowired
ServicioUjaPackImpl ujaPack;
@Test
public void testcrearEnvio(){
Assertions.assertNotNull(ujaPack.crearEnvio("Jose","Maria","Castellon","Islas Baleares",0.5f,20.4f,20.4f,20.4f));
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package es.ujaen.dae.Ujapack.entidades;
import es.ujaen.dae.entidades.Envio;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
/**
*
* @author Rafael
*/
public class EnvioTest {
@Test
public void testCalcularImporte(){
Envio e = new Envio("Jose","Maria","Castellon","Islas Baleares",0.5f,20.4f,20.4f,20.4f);
Assertions.assertNotNull(e.calcularImporte(e));
}
}
uml.jpg

83.3 KB

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment