Skip to content

Commit

Permalink
WIP: Cleaned up code, fixed exception skip
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese committed Oct 13, 2023
1 parent aa26227 commit e3f1a77
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 156 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.wse.qanaryexplanationservice.controller;

import com.wse.qanaryexplanationservice.pojos.AutomatedTestRequestBody;
import com.wse.qanaryexplanationservice.pojos.automatedTestingObject.AnnotationType;
import com.wse.qanaryexplanationservice.pojos.automatedTestingObject.AutomatedTestRequestBody;
import com.wse.qanaryexplanationservice.repositories.AutomatedTestingRepository;
import com.wse.qanaryexplanationservice.services.AutomatedTestingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -20,15 +18,6 @@ public class AutomatedTestController {
@Autowired
private AutomatedTestingRepository automatedTestingRepository;

/*
@PostMapping(value = "/automatedtest", consumes = {
"application/json"
})
public ResponseEntity<?> explanationsTests(@RequestBody String requestBody) throws Exception {
return new ResponseEntity<>(automatedTestingService.selectTestingTriple(AnnotationType.annotationofinstance), HttpStatus.OK);
}
*/

@PostMapping(value = "/automatedtests", consumes = {
"application/json"
})
Expand All @@ -49,15 +38,4 @@ public ResponseEntity<?> getExplanationsWithoutGptExplanation(@RequestBody Autom
return new ResponseEntity<>(explanations, HttpStatus.OK);
}

@GetMapping(value = "/getcomponents")
public ResponseEntity<?> getComponent(@RequestBody String requestBody) {
return new ResponseEntity<>(automatedTestingService.getcomps(AnnotationType.valueOf(requestBody)), HttpStatus.OK);
}


@GetMapping("/dataset")
public ResponseEntity<?> getDataset() {
return new ResponseEntity<>("", HttpStatus.OK);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.wse.qanaryexplanationservice.pojos;
package com.wse.qanaryexplanationservice.pojos.automatedTestingObject;

import com.wse.qanaryexplanationservice.pojos.Example;

public class AutomatedTestRequestBody {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wse.qanaryexplanationservice.pojos;
package com.wse.qanaryexplanationservice.pojos.automatedTestingObject;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.wse.qanaryexplanationservice.repositories;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.wse.qanaryexplanationservice.pojos.QanaryRequestObject;
import com.wse.qanaryexplanationservice.pojos.automatedTestingObject.QanaryRequestObject;
import com.wse.qanaryexplanationservice.pojos.automatedTestingObject.QanaryResponseObject;
import com.wse.qanaryexplanationservice.services.ParameterStringBuilder;
import org.apache.jena.query.QueryExecution;
Expand Down Expand Up @@ -56,7 +56,6 @@ public QanaryResponseObject executeQanaryPipeline(QanaryRequestObject qanaryRequ
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.writeBytes(ParameterStringBuilder.getParamsString(parameters));
out.flush();
logger.info(out.toString());
out.close();


Expand Down
Loading

0 comments on commit e3f1a77

Please sign in to comment.