Commit f3bb644f authored by Sheng Wang's avatar Sheng Wang
Browse files

add more logs in integretion tests

parent dfbe9d25
Pipeline #27560 failed with stages
in 8 minutes and 37 seconds
......@@ -42,6 +42,7 @@ public abstract class ActivityPlanTest extends TestBase {
protected static String token;
public static void classSetup(String theToken) throws Exception {
System.out.println("===ActivityPlanTest");
token = theToken;
TestUtils.disableSslVerification();
String well_schema = SchemaUtil.buildWell();
......@@ -73,6 +74,11 @@ public abstract class ActivityPlanTest extends TestBase {
String path = String.format("activityPlans/v1/by_well/%s", WELL_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
long version = EntityUtil.getVersion(response, PLAN_TYPE, PLAN_ID);
Assert.assertEquals(PLAN_VERSION, version);
......
......@@ -43,6 +43,7 @@ public abstract class BHARunTest extends TestBase {
public static void classSetup(String theToken) throws Exception {
System.out.println("===BHARunTest");
token = theToken;
TestUtils.disableSslVerification();
String bharun_schema = SchemaUtil.buildBHARun();
......@@ -75,6 +76,11 @@ public abstract class BHARunTest extends TestBase {
String path = String.format("bhaRuns/v1/by_section/%s", SECTION_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
EntityUtil.EnitityMock[] bharuns = getBHARuns(response);
String bharunid = String.format("srn:<namespace>:work-product-component/%s:%s", BHARUN_TYPE, BHARUN_ID);
......
......@@ -53,6 +53,7 @@ public abstract class DrillingProgramTest extends TestBase {
public static void classSetup(String theToken) throws Exception {
System.out.println("===DrillingProgramTest");
token = theToken;
TestUtils.disableSslVerification();
String well_schema = SchemaUtil.buildWell();
......@@ -100,6 +101,11 @@ public abstract class DrillingProgramTest extends TestBase {
String path = String.format("drillingPrograms/v1/by_well/%s", WELL_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
long version = EntityUtil.getVersion(response, DP_TYPE, DP_ID);
Assert.assertEquals(DP_VERSION, version);
......@@ -110,6 +116,11 @@ public abstract class DrillingProgramTest extends TestBase {
String path = String.format("drillingPrograms/v1/by_well/%s/%s", WELL_ID, DP_VERSION);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
long version = EntityUtil.getVersion(response, DP_TYPE, DP_ID);
Assert.assertEquals(DP_VERSION, version);
......@@ -120,6 +131,11 @@ public abstract class DrillingProgramTest extends TestBase {
String path = String.format("drillingPrograms/v1/reference_tree/by_well/%s", WELL_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
ReferenceTreeMock tree = getReferenceTree(response);
Assert.assertEquals(DP_ID, tree.id);
......@@ -131,6 +147,11 @@ public abstract class DrillingProgramTest extends TestBase {
String path = String.format("drillingPrograms/v1/reference_tree/by_well/%s/%s", WELL_ID, DP_VERSION);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
ReferenceTreeMock tree = getReferenceTree(response);
Assert.assertEquals(DP_ID, tree.id);
......@@ -143,6 +164,11 @@ public abstract class DrillingProgramTest extends TestBase {
String path = String.format("drillingPrograms/v1/full_content/by_well/%s", WELL_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
}
......@@ -151,6 +177,11 @@ public abstract class DrillingProgramTest extends TestBase {
String path = String.format("drillingPrograms/v1/versions/by_well/%s", WELL_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
long[] array = getVersionNumbers(response);
Assert.assertTrue(array != null);
......
......@@ -59,6 +59,7 @@ public abstract class QueryTest extends TestBase {
protected static String token;
public static void classSetup(String theToken) throws Exception {
System.out.println("===QueryTest");
token = theToken;
TestUtils.disableSslVerification();
String well_schema = SchemaUtil.buildWell();
......@@ -116,6 +117,11 @@ public abstract class QueryTest extends TestBase {
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
String body = String.format("[\"%s\"]", WELL_ID);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "POST", headers, body,"");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
EntityUtil.EnitityMock[] entities = getEntities(response);
String bharunid = String.format("srn:<namespace>:work-product-component/%s:%s", BHARUN_TYPE, BHARUN_ID);
......@@ -128,6 +134,11 @@ public abstract class QueryTest extends TestBase {
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
String body = String.format("[\"%s\"]", WELL_ID);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "POST", headers, body,"");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
EntityUtil.EnitityMock[] entities = getEntities(response);
String trajectoryid = String.format("srn:<namespace>:work-product-component/%s:%s", TRAJECTORY_TYPE, TRAJECTORY_ID);
......
......@@ -43,6 +43,7 @@ public abstract class SectionTest extends TestBase {
public static void classSetup(String theToken) throws Exception {
System.out.println("===SectionTest");
token = theToken;
TestUtils.disableSslVerification();
String section_schema = SchemaUtil.buildSection();
......@@ -75,6 +76,11 @@ public abstract class SectionTest extends TestBase {
String path = String.format("sections/v1/by_wellbore/%s", WELLBORE_ID);
Map<String, String> headers = HeaderUtils.getHeaders(TenantUtils.getTenantName(), token);
ClientResponse response = TestUtils.send(EntityUtil.getEntityUrl(), path, "GET", headers, "","");
System.out.println(String.format("response status: %d %s", response.getStatus(), response.getStatusInfo().getReasonPhrase()));
if(response.getStatus() != HttpStatus.SC_OK) {
String message = EntityUtil.getMessage(response);
System.out.println(message);
}
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
EntityUtil.EnitityMock[] sections = getSections(response);
String sectionid = String.format("srn:<namespace>:work-product-component/%s:%s", SECTION_TYPE, SECTION_ID);
......
......@@ -30,6 +30,7 @@ public abstract class EntityTest extends TestBase{
protected static String token;
public static void classSetup(String theToken) throws Exception {
System.out.println("===EntityTest");
token = theToken;
TestUtils.disableSslVerification();
String schema = SchemaUtil.buildWell();
......
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 to comment