configure test profiles

This commit is contained in:
DOHA
2016-10-23 12:19:55 +02:00
parent 8cdc680e6f
commit bc9b170e89
6 changed files with 198 additions and 75 deletions
@@ -2,20 +2,16 @@ package com.baeldung.cxf.introduction;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;
import com.baeldung.cxf.introduction.Baeldung;
import com.baeldung.cxf.introduction.Student;
import com.baeldung.cxf.introduction.StudentImpl;
import org.junit.Before;
import org.junit.Test;
public class StudentTest {
public class StudentLiveTest {
private static QName SERVICE_NAME = new QName("http://introduction.cxf.baeldung.com/", "Baeldung");
private static QName PORT_NAME = new QName("http://introduction.cxf.baeldung.com/", "BaeldungPort");
@@ -25,7 +21,7 @@ public class StudentTest {
{
service = Service.create(SERVICE_NAME);
String endpointAddress = "http://localhost:8080/baeldung";
final String endpointAddress = "http://localhost:8082/cxf-introduction/baeldung";
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);
}
@@ -37,28 +33,28 @@ public class StudentTest {
@Test
public void whenUsingHelloMethod_thenCorrect() {
String endpointResponse = baeldungProxy.hello("Baeldung");
String localResponse = baeldungImpl.hello("Baeldung");
final String endpointResponse = baeldungProxy.hello("Baeldung");
final String localResponse = baeldungImpl.hello("Baeldung");
assertEquals(localResponse, endpointResponse);
}
@Test
public void whenUsingHelloStudentMethod_thenCorrect() {
Student student = new StudentImpl("John Doe");
String endpointResponse = baeldungProxy.helloStudent(student);
String localResponse = baeldungImpl.helloStudent(student);
final Student student = new StudentImpl("John Doe");
final String endpointResponse = baeldungProxy.helloStudent(student);
final String localResponse = baeldungImpl.helloStudent(student);
assertEquals(localResponse, endpointResponse);
}
@Test
public void usingGetStudentsMethod_thenCorrect() {
Student student1 = new StudentImpl("Adam");
final Student student1 = new StudentImpl("Adam");
baeldungProxy.helloStudent(student1);
Student student2 = new StudentImpl("Eve");
final Student student2 = new StudentImpl("Eve");
baeldungProxy.helloStudent(student2);
Map<Integer, Student> students = baeldungProxy.getStudents();
final Map<Integer, Student> students = baeldungProxy.getStudents();
assertEquals("Adam", students.get(1).getName());
assertEquals("Eve", students.get(2).getName());
}