diff --git a/Backend-libXML/main.py b/Backend-libXML/main.py index 4445cab..e4fefe5 100644 --- a/Backend-libXML/main.py +++ b/Backend-libXML/main.py @@ -9,11 +9,11 @@ import Parser app = Flask(__name__) CORS(app) -cors = CORS(app, resource={ - r"/*":{ - "origins":"*" - } -}) +# cors = CORS(app, resource={ +# r"/*":{ +# "origins":"*" +# } +# }) def process_xml(request: request, type: str) -> str: """Function to process diff --git a/Backend-libXML/requirements.txt b/Backend-libXML/requirements.txt index 7c41ff0..abb4521 100644 --- a/Backend-libXML/requirements.txt +++ b/Backend-libXML/requirements.txt @@ -1,3 +1,3 @@ -lxml -flask -flask_cors \ No newline at end of file +lxml==4.9.2 +flask==2.3.2 +flask_cors==3.0.10 \ No newline at end of file diff --git a/Backend/mocked-services/pom.xml b/Backend/mocked-services/pom.xml index 0a6ceb7..96e6d0e 100644 --- a/Backend/mocked-services/pom.xml +++ b/Backend/mocked-services/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.1.RELEASE + 2.7.11 @@ -18,9 +18,10 @@ 3.3.0 1.1.6 3.16.1 - 1.3.1.Final + 1.5.5.Final Release11 ${project.artifactId} + 1.18.26 @@ -57,21 +58,6 @@ org.springframework.boot spring-boot-starter-data-redis - - com.cwbase - logback-redis-appender - ${logback-redis-appender.version} - - - redis.clients - jedis - ${jedis.version} - - - org.codehaus.jettison - jettison - 1.4.1 - @@ -101,6 +87,11 @@ lombok ${lombok.version} + + org.projectlombok + lombok-mapstruct-binding + 0.2.0 + -Amapstruct.defaultComponentModel=spring diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java b/Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java deleted file mode 100644 index c3438d2..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.r11.tools.config; - -import java.util.Objects; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.Environment; -import org.springframework.data.redis.connection.RedisStandaloneConfiguration; -import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import redis.clients.jedis.JedisPool; - -/** - * Class containing configuration for Redis db client - * @author Rafał Żukowicz - */ -@Configuration -@EnableRedisRepositories -@PropertySource("classpath:data-access.properties") -public class RedisConfig { - - @Autowired - private Environment environment; - - /** - * Bean of JedisPool - the Redis client. It stores requests in "the pool" and then fires them at Redis. - * It's considered super lightweight and fast client variant - * @return lightweight client of the Redis - the JedisPool - */ - @Bean - JedisPool jedisPool(){ - final JedisPool pool = new JedisPool(environment.getProperty("redis.host"), - Integer.parseInt(environment.getProperty("redis.port"))); - return pool; - } - - /** - * Bean of a factory for connenction object. - * It's initialized with Redis db url property and is fed to other methods. - * @return the factory for RedisTemplates - */ - @Bean - JedisConnectionFactory jedisConnectionFactory() { - RedisStandaloneConfiguration redisStandaloneConfiguration = - new RedisStandaloneConfiguration(Objects.requireNonNull(environment.getProperty("redis.host")), - Integer.parseInt(Objects.requireNonNull(environment.getProperty("redis.port")))); - return new JedisConnectionFactory(redisStandaloneConfiguration); - } - - /** - * RedisTemplate is the tool to store and retrieve given type (object) of hash from the database. - * It's like you could store your Java object by just naming it inside database. You might thing about it - * as of DAO. - * @return RedisTemplate the redis dao. - */ - @Bean - public RedisTemplate redisTemplate() { - RedisTemplate redisTemplate = new RedisTemplate<>(); - redisTemplate.setConnectionFactory(jedisConnectionFactory()); - redisTemplate.setExposeConnection(true); - redisTemplate.setDefaultSerializer(new GenericJackson2JsonRedisSerializer()); - return redisTemplate; - } - -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java new file mode 100644 index 0000000..3923df0 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java @@ -0,0 +1,64 @@ +package com.r11.tools.configuration; + +import com.r11.tools.repository.MockedResponseRepository; +import com.r11.tools.repository.RequestHistoryRepository; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.time.LocalDateTime; + +/** + * Based on configuration deletes all outdated messages and history records from database. + * + * @author Mikołaj Widła + */ + +@EnableScheduling +@EnableAsync +@Configuration +public class RetentionConfiguration { + + private final MockedResponseRepository responseRepository; + private final RequestHistoryRepository historyRepository; + private final RetentionConfigurationProperties retentionProperties; + private final Logger log = LogManager.getRootLogger(); + + + public RetentionConfiguration(MockedResponseRepository responseRepository, + RequestHistoryRepository historyRepository, + RetentionConfigurationProperties retentionProperties){ + this.historyRepository = historyRepository; + this.responseRepository = responseRepository; + this.retentionProperties = retentionProperties; + } + @Scheduled(fixedDelayString = "#{${retention.retention-cooldown} * 60000 }") + @Async + public void deleteMessagesAndHistoryRecords(){ + log.info("OUTDATED MESSAGES AND HISTORY RECORDS DELETED!"); + responseRepository + .findAll() + .iterator() + .forEachRemaining( mockedMessage -> { + if (mockedMessage.getCreatedAt().plusMinutes(retentionProperties.getMinutesToDeleteMessage()).isBefore(LocalDateTime.now())){ + responseRepository.delete(mockedMessage); + } + } ); + + historyRepository + .findAll() + .iterator() + .forEachRemaining( + historyRecord -> { + if (historyRecord.getDateTimeStamp().plusMinutes(retentionProperties.getMinutesToDeleteHistoryRecord()).isBefore(LocalDateTime.now())){ + historyRepository.delete(historyRecord); + } + } + ); + } + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java new file mode 100644 index 0000000..00aac59 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java @@ -0,0 +1,31 @@ +package com.r11.tools.configuration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import javax.validation.constraints.Positive; + +/** + * Store all properties needed to change a retention in {@link RetentionConfiguration} + * + * @author Mikołaj Widła + */ + +@Configuration +@ConfigurationProperties(prefix = "retention") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class RetentionConfigurationProperties { + @Positive + private Integer minutesToDeleteMessage; + @Positive + private Integer minutesToDeleteHistoryRecord; + @Positive + private Integer retentionCooldown; +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java new file mode 100644 index 0000000..52cdc81 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java @@ -0,0 +1,28 @@ +package com.r11.tools.configuration; + +import com.r11.tools.interceptor.IncomingMockRequestInterceptor; +import lombok.AllArgsConstructor; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Configuration for {@link IncomingMockRequestInterceptor} + * + * @author Mikołaj Widła + */ + +@Configuration +@AllArgsConstructor +public class WebConfig implements WebMvcConfigurer{ + + private final IncomingMockRequestInterceptor requestInterceptor; + + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor( requestInterceptor ) + .addPathPatterns("/api/mock/r/**"); + } + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java deleted file mode 100644 index 81ff153..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.r11.tools.controller; - -import com.r11.tools.model.EventRequestDto; -import com.r11.tools.service.EtrackService; -import lombok.AllArgsConstructor; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import java.time.LocalDateTime; -import java.util.UUID; - -/** - * It's the REST api for {@link com.r11.tools.model.Event} - * @author Gabriel Modzelewski - */ -@RestController -@RequestMapping(path = "/api/event") -@AllArgsConstructor -public class EventController { - private final EtrackService service; - - /** - * Returns the list of Events in given time bracket. - * The list of objects is received via {@link EventRequestDto}, which contains time brackets, - * as well as the key - uuid. - * @param event EventRequestDto object that contains data needed to query the database - * @return list of {@link com.r11.tools.model.Event} - */ - @PostMapping - public ResponseEntity filterHistory(@RequestBody EventRequestDto event){ - return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(event), HttpStatus.OK); - } - - /** - * Returns the list of Events of last 24h from given date. - * @param uuid unique id of message list - * @param messageId unique id of message in message list - * @return list of {@link com.r11.tools.model.Event} - */ - @GetMapping(path = "/{uuid}/{messageId}") - public ResponseEntity getLastDay(@PathVariable UUID uuid, - @PathVariable Integer messageId){ - LocalDateTime requestTime = LocalDateTime.now(); - LocalDateTime dayBeforeRequest = requestTime.minusDays(1L); - EventRequestDto eventRequestDto = EventRequestDto.builder() - .clientUUID(uuid) - .mockedResponseId(messageId) - .localDateTimeFrom(dayBeforeRequest) - .localDateTimeTo(requestTime) - .build(); - return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(eventRequestDto), HttpStatus.OK); - } - - -} - diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java deleted file mode 100644 index e4c3b66..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.r11.tools.controller; - -import lombok.SneakyThrows; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -/** - * Class responsible for returning homepage html - * @author Gabriel Modzelewski - */ -@Controller -@RequestMapping("/") -public class MainController { - /** - * Default path to get the homepage - * @return the view of homepage - */ - @SneakyThrows - @GetMapping - public ModelAndView showHome(){ - ModelAndView mov = new ModelAndView(); - mov.setViewName("html/mock"); - return mov; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java index 8ec6473..a9af2c3 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java @@ -3,13 +3,14 @@ package com.r11.tools.controller; import com.fasterxml.jackson.databind.ObjectMapper; import com.r11.tools.model.MockedMessageDto; import com.r11.tools.service.KlausService; -import com.r11.tools.utilis.BusinessKey; -import com.r11.tools.utilis.TrackingClient; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.springframework.http.*; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -18,17 +19,19 @@ import java.util.*; /** * Returns the homepage and provides the api for javascript async requests. * @author Gabriel Modzelewski + * @author Mikołaj Widła */ @RestController @RequestMapping(path = "/api/mock") @AllArgsConstructor +@CrossOrigin(origins = "*") public class MockController { private final KlausService klausService; private final Logger log = LogManager.getRootLogger(); @ExceptionHandler(Exception.class) public void errorHandler(Exception ex){ - log.error(ex.getStackTrace()); + log.error(Arrays.toString(ex.getStackTrace())); } /** @@ -48,106 +51,35 @@ public class MockController { * Returns the full list of messages. It's used by javascript on the client side to initialize homepage * with data from the database. * @param uuidValue the key-uuid of given set of messages - * @return responds with 200 OK and list of {@link MockedMessageDto} + * @return responds with 200 OK and {@link MockedMessageDto} */ @GetMapping({"/", "/{uuidValue}"}) - public List getListOfMessages(@PathVariable(required = false) String uuidValue){ + public MockedMessageDto getMessage(@PathVariable(required = false) String uuidValue){ UUID clientUUID; + MockedMessageDto message ; if(uuidValue == null || uuidValue.equals("")) clientUUID = UUID.randomUUID(); else clientUUID = UUID.fromString(uuidValue); - List messages = klausService.getAllMockedResponses(clientUUID); - if(messages.size() == 0) { - klausService.setMockedResponse(buildDefaultMessage(clientUUID)); - messages = klausService.getAllMockedResponses(clientUUID); - } - Collections.sort(messages); - return messages; - } + message = klausService + .getMockedMessageByClientUUID(clientUUID) + .orElse( buildDefaultMessage(clientUUID) ); - /** - * If provided UUID does not exist in database returns ResponseEntity with new generated UUID(if previous UUID is not provided), - * or old UUID(if previous UUID is provided). If provided UUID exists function returns provided UUID. - * @param givenUUIDValue the UUID client wants to check exsitance in database - * @param previousUUIDValue the previous UUID used by client(optional variable) - * @return ResponseEntity with UUID - */ - @RequestMapping( - method = RequestMethod.GET , - path = {"/check/{givenUUIDValue}/{previousUUIDValue}", - "/check/{givenUUIDValue}"}) - public ResponseEntity checkUUID( - @PathVariable String givenUUIDValue - ,@PathVariable(required = false) String previousUUIDValue ){ - try{ - UUID.fromString(givenUUIDValue); - } catch (IllegalArgumentException ex){ - log.error("Wrong UUID value!"); - if (previousUUIDValue == null || previousUUIDValue.equals("")){ - UUID newUUID = UUID.randomUUID(); - log.info("New UUID generated."); - return ResponseEntity.ok(newUUID.toString()); - } - log.info("Previous UUID value restored."); - return ResponseEntity.ok(previousUUIDValue); - } - return ResponseEntity.ok(givenUUIDValue); - } - - /** - * Accepts empty post request and creates new message in given set. The new message has default set of data, - * which is constructed in {@link #buildDefaultMessage(UUID, int)} method. - * @param uuidValue the key-uuid of given set of messages - * @return confirmation response with 200 OK - */ - @PostMapping("/{uuidValue}") - public ResponseEntity addNewMessage(@PathVariable String uuidValue){ - UUID clientUUID = UUID.fromString(uuidValue); - List messages = klausService.getAllMockedResponses(clientUUID); - MockedMessageDto nextMessage = buildDefaultMessage(clientUUID, findNextId(messages)); - return klausService.setMockedResponse(nextMessage); - } - - /** - * Deletes message of given id via client request - * @param uuidValue the key-uuid of given set of messages - * @param idValue unique id of given message - * @return after deletion the confirmation is send with status 200 OK - */ - @DeleteMapping("/{uuidValue}/{idValue}") - public ResponseEntity removeMessage(@PathVariable String uuidValue, - @PathVariable String idValue){ - UUID clientUUID = UUID.fromString(uuidValue); - int id = Integer.parseInt(idValue); - return klausService.deleteMockedResponse(clientUUID, id); - } - - - /** - * Recalls {@link #buildDefaultMessage(UUID)} for message construction and sets id of message - * @param uuid the key-uuid of given set of messages - * @param id unique id of given message - * @return message with default dataset and set id - */ - private static MockedMessageDto buildDefaultMessage(UUID uuid, int id){ - MockedMessageDto message = buildDefaultMessage(uuid); - message.setMockedResponseId(id); return message; } + /** * Constructs message with default set of data * @param uuid the key-uuid of given set of messages * @return message with default dataset */ - private static MockedMessageDto buildDefaultMessage(UUID uuid){ + private MockedMessageDto buildDefaultMessage(UUID uuid){ Map headers = new HashMap<>(); headers.put("Keep-Alive", "timeout=60"); headers.put("Connection", "keep-alive"); headers.put("Date", LocalDateTime.now().toString()); - return MockedMessageDto.builder() + MockedMessageDto mockedMessageDto = MockedMessageDto.builder() .clientUUID(uuid) - .mockedResponseId(1) - .mediaType(MediaType.APPLICATION_XML_VALUE) + .contentType(MediaType.APPLICATION_XML_VALUE) .messageBody("\n" + "\n" + " Tove\n" + @@ -158,46 +90,24 @@ public class MockController { .httpHeaders(headers) .httpStatus(200) .build(); + klausService.setMockedResponse(mockedMessageDto); + return mockedMessageDto; } - - /** - * Finds the highest id in the list and returns it incremented by 1 - * @param messages list of messages - * @return highest id incremented by 1 - */ - public static int findNextId(List messages) { - int highestId = 0; - for (MockedMessageDto m : messages) - highestId = highestId > m.getMockedResponseId() ? highestId : m.getMockedResponseId(); - return ++highestId; - } - /** * It's one of the most important features - the bread and butter of the Mocked Service. It's link that allows * to receive mocked response from the server and use it to mock! - * @param requestEntity Logs the data of request * @param clientUUID the key-uuid of given set of messages - * @param mockedResponseId unique id of given message * @return */ - @GetMapping(value = "/r/{clientUUID}/{mockedResponseId}") - public ResponseEntity getMockedResponse(RequestEntity requestEntity, - @PathVariable UUID clientUUID, - @PathVariable int mockedResponseId) { - TrackingClient.setBusinessKeys(Map.of(BusinessKey.INTERFACE_NAME, "getMockedResponse - request", - BusinessKey.CLIENT_UUID, String.valueOf(clientUUID), - BusinessKey.MESSAGE_ID, String.valueOf(mockedResponseId))); - // log.info(requestEntity.toString().replaceAll("\"", "\\\\\"").substring(1).replaceAll("\n","")); - TrackingClient.setBusinessKeys(Map.of(BusinessKey.INTERFACE_NAME, "getMockedResponse - response", - BusinessKey.CLIENT_UUID, String.valueOf(clientUUID), - BusinessKey.MESSAGE_ID, String.valueOf(mockedResponseId))); - MockedMessageDto mockedMessageDto = klausService.getMockedResponse(clientUUID, mockedResponseId); + @RequestMapping(value = "/r/{clientUUID}") + public ResponseEntity getMockedResponse( + @PathVariable UUID clientUUID) { + MockedMessageDto mockedMessageDto = klausService.getMockedResponse(clientUUID); HttpHeaders httpHeaders = new HttpHeaders(); if (mockedMessageDto.getHttpHeaders() != null) mockedMessageDto.getHttpHeaders().forEach(httpHeaders::set); - httpHeaders.add("Content-Type", mockedMessageDto.getMediaType()); + httpHeaders.add("Content-Type", mockedMessageDto.getContentType()); return new ResponseEntity<>(mockedMessageDto.getMessageBody(), httpHeaders, Objects.requireNonNull(HttpStatus.valueOf(mockedMessageDto.getHttpStatus()))); } - } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java index 2c9f582..1879df5 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java @@ -7,6 +7,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindException; import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.ExceptionHandler; @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; * @author Rafał Żukowicz */ @ControllerAdvice +@CrossOrigin(origins = "*") public class MvcExceptionHandler { /** diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java new file mode 100644 index 0000000..bfd7ddb --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java @@ -0,0 +1,42 @@ +package com.r11.tools.controller; + +import com.r11.tools.mappers.RequestHistoryMapper; +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import com.r11.tools.service.RequestHistoryService; +import lombok.AllArgsConstructor; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * It's the REST api for {@link RequestHistory} + * @author Gabriel Modzelewski + * @author Mikołaj Widła + */ +@RestController +@RequestMapping(path = "/api/event") +@AllArgsConstructor +@CrossOrigin(origins = "*") +public class RequestHistoryController { + private final RequestHistoryService service; + private final RequestHistoryMapper mapper; + + /** + * Returns the list of Events. + * @param uuid unique id of message list + * @return list of {@link RequestHistory} + */ + @GetMapping(path = "/{uuid}") + public ResponseEntity> getLastDay(@PathVariable String uuid){ + List requestHistory = service.getHistoryRecordsByUUID( + uuid + ).stream() + .map(mapper::requestHistoryToRequestHistoryDTO) + .collect(Collectors.toList()); + return ResponseEntity.ok(requestHistory); + } +} + diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java b/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java new file mode 100644 index 0000000..0693ef9 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java @@ -0,0 +1,78 @@ +package com.r11.tools.interceptor; + +import com.r11.tools.model.RequestHistoryDTO; +import com.r11.tools.service.RequestHistoryService; +import lombok.AllArgsConstructor; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Component; +import org.springframework.util.StreamUtils; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.HandlerMapping; +import org.springframework.web.util.ContentCachingRequestWrapper; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.nio.charset.Charset; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +/** + * Interceptor that gets needed data from HttpRequest, and saves it to history + * @author Mikołaj Widła + */ + +@Component +@AllArgsConstructor +public class IncomingMockRequestInterceptor implements HandlerInterceptor { + + private final RequestHistoryService historyService; + + @Override + public boolean preHandle(HttpServletRequest httpRequest, HttpServletResponse response, Object handler){ + Map headers = getHeadersFromHttpRequest(httpRequest); + Map pathVariable = getPathVariablesFromHttpRequest(httpRequest); + String requestBody = getRequestBodyFromHttpRequest(httpRequest); + + RequestHistoryDTO historyDTO = RequestHistoryDTO.builder() + .httpMethod(HttpMethod.valueOf(httpRequest.getMethod())) + .headers( headers ) + .clientUUID(UUID.fromString(pathVariable.get("clientUUID"))) + .dateTimeStamp(LocalDateTime.now()) + .requestBody(requestBody) + .build(); + historyService.saveRequest(historyDTO); + return true; + } + + private Map getHeadersFromHttpRequest( HttpServletRequest httpRequest ){ + Set headersName = StreamSupport.stream( + Spliterators.spliteratorUnknownSize( + httpRequest.getHeaderNames().asIterator(), + Spliterator.ORDERED + ), false + ).collect(Collectors.toSet()); + + return headersName.stream() + .collect(Collectors.toMap( + value -> value, + httpRequest::getHeader + )); + } + + private Map getPathVariablesFromHttpRequest( HttpServletRequest httpRequest ){ + return (Map) httpRequest.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); + } + + private String getRequestBodyFromHttpRequest( HttpServletRequest httpRequest ){ + HttpServletRequest wrappedRequest = new ContentCachingRequestWrapper(httpRequest); + try { + return StreamUtils.copyToString(wrappedRequest.getInputStream(), Charset.defaultCharset()); + } catch (IOException e) { + return ""; + } + } + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java index 882ab09..af0098f 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java @@ -4,14 +4,23 @@ import com.r11.tools.model.MockedMessage; import com.r11.tools.model.MockedMessageDto; import org.mapstruct.*; +import java.util.Optional; + /** * Creates key value for redis entry * @author Rafał Źukowicz */ @Mapper public interface MockedMessageMapper { - @Mapping( target = "compositePrimaryKey", expression = "java(mockedMessageDto.getClientUUID() + \"_\"" + - " + mockedMessageDto.getMockedResponseId())") + @Mapping( target = "createdAt" , expression = "java(java.time.LocalDateTime.now())") MockedMessage mockedMessageDtoToMockedMessage(MockedMessageDto mockedMessageDto); MockedMessageDto mockedMessageToMockedMessageDto(MockedMessage mockedMessage); + + default Optional optionalMockedMessageToOptionalMockedMessageDTO(Optional optionalMockedMessage){ + return optionalMockedMessage.map(this::mockedMessageToMockedMessageDto); + } + + default Optional optionalMockedMessageDTOToOptionalMockedMessage(Optional optionalMockedMessageDto){ + return optionalMockedMessageDto.map(this::mockedMessageDtoToMockedMessage); + } } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java new file mode 100644 index 0000000..5f97e92 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java @@ -0,0 +1,23 @@ +package com.r11.tools.mappers; + +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; + +/** +* Map between DTO and Entity +* +* @author Mikołaj Widła +* + */ + +@Mapper +public interface RequestHistoryMapper { + + @Mapping(target = "clientUUID", expression = "java(requestHistoryDTO.getClientUUID().toString())") + RequestHistory requestHistoryDTOToRequestHistory(RequestHistoryDTO requestHistoryDTO); + @Mapping(target = "clientUUID", expression = "java(java.util.UUID.fromString(requestHistory.getClientUUID()))") + RequestHistoryDTO requestHistoryToRequestHistoryDTO(RequestHistory requestHistory); + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java deleted file mode 100644 index 4bd0b4e..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.r11.tools.model; - -import java.time.LocalDateTime; -import lombok.*; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.lang.Nullable; - -/** - * Pojo class for Event entity - * @author Rafał Żukowicz - */ -@Data -@Builder -@ToString -@NoArgsConstructor -@AllArgsConstructor -public class Event implements Comparable{ - - @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") - private LocalDateTime dateTimeStamp; - @Nullable - private String interfaceName; - @Nullable - private String clientUUID; - @Nullable - private Integer messageId; - private String thread; - private String level; - @Nullable - private String message; - - @Override - public int compareTo(Event o) { - return this.getDateTimeStamp().compareTo(o.getDateTimeStamp()) * -1; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java index 29989d4..a0b6d0e 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java @@ -1,10 +1,6 @@ package com.r11.tools.model; import com.r11.tools.model.constraints.HttpCode; -import java.io.Serializable; -import java.util.Map; -import java.util.UUID; -import javax.validation.constraints.Positive; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -13,6 +9,11 @@ import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; import org.springframework.data.redis.core.index.Indexed; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.UUID; + /** * MockedMessage redis entity pojo * @author Rafał Żukowicz @@ -23,18 +24,14 @@ import org.springframework.data.redis.core.index.Indexed; @NoArgsConstructor @AllArgsConstructor public class MockedMessage implements Serializable { - @Id - private String compositePrimaryKey; @Indexed + @Id private UUID clientUUID; - @Positive - private Integer mockedResponseId; - private String mediaType; + private String contentType; private String messageBody; private Map httpHeaders; @HttpCode private Integer httpStatus; + private LocalDateTime createdAt; } - - diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java index caae824..d3206ed 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java @@ -1,12 +1,11 @@ package com.r11.tools.model; import com.r11.tools.model.constraints.HttpCode; +import lombok.*; + import java.io.Serializable; import java.util.Map; import java.util.UUID; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; -import lombok.*; /** * Alternative version of {@link MockedMessage} used in http body @@ -18,19 +17,12 @@ import lombok.*; @ToString @NoArgsConstructor @AllArgsConstructor -public class MockedMessageDto implements Serializable, Comparable { +public class MockedMessageDto implements Serializable{ private UUID clientUUID; - @NotNull - @Positive - private Integer mockedResponseId; - private String mediaType; + private String contentType; private String messageBody; private Map httpHeaders; @HttpCode private Integer httpStatus; - @Override - public int compareTo(MockedMessageDto message) { - return this.mockedResponseId > message.getMockedResponseId() ? 1 : -1; - } } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java new file mode 100644 index 0000000..1c17387 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java @@ -0,0 +1,42 @@ +package com.r11.tools.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.redis.core.RedisHash; +import org.springframework.data.redis.core.index.Indexed; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpMethod; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; + +/** + * Pojo class for Event entity + * @author Rafał Żukowicz + * @author Mikołaj Widła + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@RedisHash("mockHistory") +public class RequestHistory implements Comparable, Serializable { + @Id + private String id; + @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") + private LocalDateTime dateTimeStamp; + @Indexed + private String clientUUID; + private Map headers; + private HttpMethod httpMethod; + private String requestBody; + + @Override + public int compareTo(RequestHistory o) { + return this.getDateTimeStamp().compareTo(o.getDateTimeStamp()) * -1; + } +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/EventRequestDto.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java similarity index 61% rename from Backend/mocked-services/src/main/java/com/r11/tools/model/EventRequestDto.java rename to Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java index ecfc03f..7c78958 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/EventRequestDto.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java @@ -1,28 +1,32 @@ package com.r11.tools.model; -import java.time.LocalDateTime; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpMethod; + +import java.time.LocalDateTime; +import java.util.Map; +import java.util.UUID; /** - * Pojo for history query request. Contains information necessary to obtain {@link Event} list + * Pojo for history query request. Contains information necessary to obtain {@link RequestHistory} list * @author Rafał Żukowicz + * @author Mikołaj Widła */ @Data @Builder @NoArgsConstructor @AllArgsConstructor -public class EventRequestDto { +public class RequestHistoryDTO { private UUID clientUUID; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private LocalDateTime localDateTimeFrom; - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private LocalDateTime localDateTimeTo; - private Integer mockedResponseId; + private LocalDateTime dateTimeStamp; + private Map headers; + private HttpMethod httpMethod; + private String requestBody; } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java deleted file mode 100644 index c634732..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.r11.tools.repository; - -import com.r11.tools.model.Event; -import com.r11.tools.utilis.BusinessKey; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.annotation.Transactional; - -/** - * Event entity dao interface - * @author Rafał Żukowicz - */ -@Repository -@Transactional -public interface EventRepository { - List findEvents(LocalDateTime localDateTimeFrom, LocalDateTime localDateTimeTo, - Map businessKeys); -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java deleted file mode 100644 index 3de0e2a..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.r11.tools.repository; - -import static com.r11.tools.utilis.RedisAppender.LOG_PREFIX; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.r11.tools.model.Event; -import com.r11.tools.utilis.BusinessKey; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Repository; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -/** - * Builds Event list based on logs created via {@link com.r11.tools.utilis.TrackingClient} and {@link com.r11.tools.utilis.RedisAppender} - * @author Rafał Żukowicz - */ -@Repository -@AllArgsConstructor -public class EventRepositoryImpl implements EventRepository { - private final JedisPool jedisPool; - private final ObjectMapper objectMapper; - - /** - * Creates list of {@link Event} based on {@link com.r11.tools.model.EventRequestDto} data via searching logs - * @param localDateTimeFrom date from which logs are retrieved - * @param localDateTimeTo date to which logs are retrieved - * @param businessKeys set keys for redis values - * @return - */ - @Override - public List findEvents(LocalDateTime localDateTimeFrom, LocalDateTime localDateTimeTo, - Map businessKeys) { - List eventStrings = findEventsBetweenDates(localDateTimeFrom.toLocalDate(), localDateTimeTo.toLocalDate()); - if (businessKeys.size() > 0) { - eventStrings = businessKeysFilter(eventStrings, businessKeys); - } - List events = parseEvents(eventStrings); - if (localDateTimeFrom.toLocalTime() != LocalTime.MIN) { - events = events.stream().filter(event -> event.getDateTimeStamp().compareTo(localDateTimeFrom) >= 0) - .collect(Collectors.toList()); - } - return events.stream().filter(event -> event.getDateTimeStamp().compareTo(localDateTimeTo) <= 0) - .collect(Collectors.toList()); - } - - /** - * Returns logs between given dates - * @param localDateFrom date from which logs are retrieved - * @param localDateTo date to which logs are retrieved - * @return - */ - private List findEventsBetweenDates(LocalDate localDateFrom, LocalDate localDateTo) { - try (Jedis jedis = jedisPool.getResource()) { - return localDateFrom.datesUntil(localDateTo.plusDays(1)).map(day -> LOG_PREFIX + day.toString()) - .map(key -> jedis.lrange(key, 0, -1)).flatMap(Collection::stream).collect(Collectors.toList()); - } - } - - /** - * Filters keys so only the ones queried are retirned - * @param events list of logs - * @param businessKeys set keys for redis values - * @return filtered list of logs - */ - private List businessKeysFilter(List events, Map businessKeys) { - for (Map.Entry entry : businessKeys.entrySet()) { - String stringPattern = entry.getKey().getReasonPhrase()+ "\"" + ":" + "\"" + entry.getValue() + "\""; - events = events.stream().filter(s -> s.contains(stringPattern)).collect(Collectors.toList()); - } - return events; - } - - /** - * Parses list of logs into list of {@link Event} - * @param eventStrings list of logs - * @return list of {@link Event} - */ - private List parseEvents(List eventStrings) { - List events = new ArrayList<>(); - for (String eventString : eventStrings) { - eventString = eventString.replaceAll("\\R", ""); - try { - events.add(objectMapper.readValue(eventString, Event.class)); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - } - return events; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java index 7b12b0b..f9296fa 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java @@ -14,11 +14,11 @@ import org.springframework.transaction.annotation.Transactional; */ @Repository @Transactional -public interface MockedResponseRepository extends CrudRepository { +public interface MockedResponseRepository extends CrudRepository { /** * Finds all messages by their uuid * @param clientUUID the key-uuid of given set of messages * @return Optional of list of {@link com.r11.tools.model.MockedMessage} */ - Optional> findAllByClientUUID(UUID clientUUID); + Optional findAllByClientUUID(UUID clientUUID); } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java new file mode 100644 index 0000000..9927937 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java @@ -0,0 +1,18 @@ +package com.r11.tools.repository; + +import com.r11.tools.model.RequestHistory; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * History Record entity dao interface + * @author Rafał Żukowicz + */ +@Repository +@Transactional +public interface RequestHistoryRepository extends CrudRepository { + List findAllByClientUUID(String clientUUID); +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java deleted file mode 100644 index 98c6658..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.r11.tools.service; - -import com.r11.tools.model.Event; -import com.r11.tools.model.EventRequestDto; -import java.util.List; -import org.springframework.stereotype.Service; - -/** - * Spring service interface for {@link com.r11.tools.controller.EventController} - * @author Rafał Żukowicz - */ -@Service -public interface EtrackService { - /** - * Searches for {@link Event} objects between date brackets - * @param eventsDto object containing required data for request - * @return list of {@link Event} - */ - List getEventsByDateTimeAndBusinessKeys(EventRequestDto eventsDto); -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java deleted file mode 100644 index ea49c17..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.r11.tools.service; - -import com.r11.tools.model.Event; -import com.r11.tools.model.EventRequestDto; -import com.r11.tools.repository.EventRepository; -import com.r11.tools.utilis.BusinessKey; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Spring Service for {@link com.r11.tools.controller.EventController}. Contains logic required for quering - * the database for {@link Event} objects - * @author Rafał Żukowicz - */ -@Service -@AllArgsConstructor -public class EtrackServiceImpl implements EtrackService { - - private final EventRepository eventRepository; - - /** - * Adds {@link BusinessKey} to {@link EventRequestDto} - * in order to create query via{@link com.r11.tools.repository.EventRepositoryImpl} - * @param eventsDto object containing required data for request - * @return list of {@link Event} - */ - @Override - public List getEventsByDateTimeAndBusinessKeys(EventRequestDto eventsDto) { - Map businessKeys = new HashMap<>(); - businessKeys.put(BusinessKey.CLIENT_UUID, eventsDto.getClientUUID().toString()); - if (eventsDto.getMockedResponseId() != null){ - businessKeys.put(BusinessKey.MESSAGE_ID, String.valueOf(eventsDto.getMockedResponseId())); - } - List events = eventRepository.findEvents(eventsDto.getLocalDateTimeFrom(), eventsDto.getLocalDateTimeTo(), - businessKeys); - Collections.sort(events); - return events; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java index 917f878..1c5079a 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java @@ -1,7 +1,8 @@ package com.r11.tools.service; import com.r11.tools.model.MockedMessageDto; -import java.util.List; + +import java.util.Optional; import java.util.UUID; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -12,8 +13,7 @@ import org.springframework.stereotype.Service; */ @Service public interface KlausService { - ResponseEntity deleteMockedResponse(UUID clientUUID, int mockedResponseId); - List getAllMockedResponses(UUID clientUUID); - MockedMessageDto getMockedResponse(UUID clientUUID, int mockedResponseId); + Optional getMockedMessageByClientUUID(UUID clientUUID); + MockedMessageDto getMockedResponse(UUID clientUUID); ResponseEntity setMockedResponse(MockedMessageDto mockedMessageDto); } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java index 2190048..08f3569 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java @@ -1,6 +1,5 @@ package com.r11.tools.service; -import com.fasterxml.jackson.databind.ObjectMapper; import com.r11.tools.mappers.MockedMessageMapper; import com.r11.tools.model.MockedMessage; import com.r11.tools.model.MockedMessageDto; @@ -13,16 +12,16 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; -import java.util.List; + import java.util.Optional; import java.util.UUID; -import java.util.stream.Collectors; /** * Service for {@link com.r11.tools.controller.MockController} and {@link com.r11.tools.controller.MockController} * Allows for performing CRUD operations on {@link MockedMessageDto} * @author Rafał Żukowicz * @author Gabriel Modzelewski + * @author Mikołaj Widła */ @Service @AllArgsConstructor @@ -30,22 +29,7 @@ public class KlausServiceImpl implements KlausService { private final MockedMessageMapper mockedMessageMapper; private final Logger log = LogManager.getRootLogger(); private final MockedResponseRepository mockedResponseRepository; - private final ObjectMapper objectMapper; - /** - * Removes message of given id in given key-uuid set - * @param clientUUID the key-uuid of given set of messages - * @param mockedResponseId unique id of given message - * @return confirmation and status 200 OK - */ - @Override - public ResponseEntity deleteMockedResponse(UUID clientUUID, int mockedResponseId) { - String key = clientUUID.toString() + "_" + mockedResponseId; - mockedResponseRepository.deleteById(key); - log.info("Message: "+mockedResponseId+" has been removed."); - return new ResponseEntity<>("MockedResponse has been removed successfully", - new HttpHeaders(), HttpStatus.ACCEPTED); - } /** * Returns all messages of given key-uuid @@ -53,28 +37,23 @@ public class KlausServiceImpl implements KlausService { * @return List of {@link MockedMessageDto} */ @Override - public List getAllMockedResponses(UUID clientUUID){ - Optional> listOptional = mockedResponseRepository.findAllByClientUUID(clientUUID); - log.info("Messages for UUID: "+clientUUID+" has been fetched from DB."); - return listOptional.map(mockedMessages -> mockedMessages.stream() - .map(mockedMessageMapper::mockedMessageToMockedMessageDto) - .collect(Collectors.toList())).orElse(List.of()); + public Optional getMockedMessageByClientUUID(UUID clientUUID){ + Optional mockedMessageOptional = mockedResponseRepository.findAllByClientUUID(clientUUID); + log.info("Message for UUID: "+clientUUID+" has been fetched from DB."); + return mockedMessageMapper.optionalMockedMessageToOptionalMockedMessageDTO(mockedMessageOptional); } /** * Returns {@link MockedMessageDto} of given id and key-uuid. If message doesn't then empty message is returned * @param clientUUID the key-uuid of given set of messages - * @param mockedResponseId unique id of given message * @return {@link MockedMessageDto} object */ @SneakyThrows @Override - public MockedMessageDto getMockedResponse(UUID clientUUID, int mockedResponseId){ - String key = clientUUID.toString() + "_" + mockedResponseId; - Optional optionalMockedMessage = mockedResponseRepository.findById(key); + public MockedMessageDto getMockedResponse(UUID clientUUID){ + Optional optionalMockedMessage = mockedResponseRepository.findById(clientUUID); MockedMessageDto mockedMessageDto = MockedMessageDto.builder() .clientUUID(clientUUID) - .mockedResponseId(mockedResponseId) .build(); if (optionalMockedMessage.isPresent()) { mockedMessageDto = mockedMessageMapper.mockedMessageToMockedMessageDto(optionalMockedMessage.get()); diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java new file mode 100644 index 0000000..ccd2206 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java @@ -0,0 +1,23 @@ +package com.r11.tools.service; + +import com.r11.tools.controller.RequestHistoryController; +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Spring service interface for {@link RequestHistoryController} + * @author Rafał Żukowicz + */ +@Service +public interface RequestHistoryService { + /** + * Searches for {@link RequestHistory} objects between date brackets + * @param uuid user uuid + * @return list of {@link RequestHistory} + */ + List getHistoryRecordsByUUID(String uuid); + void saveRequest(RequestHistoryDTO requestDTO); +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java new file mode 100644 index 0000000..c0da875 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java @@ -0,0 +1,38 @@ +package com.r11.tools.service; + +import com.r11.tools.controller.RequestHistoryController; +import com.r11.tools.mappers.RequestHistoryMapper; +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import com.r11.tools.repository.RequestHistoryRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; + +/** + * Spring Service for {@link RequestHistoryController}. Contains logic required for quering + * the database for {@link RequestHistory} objects + * @author Rafał Żukowicz + * @author Mikołaj Widła + */ +@Service +@AllArgsConstructor +public class RequestHistoryServiceImpl implements RequestHistoryService { + + private final RequestHistoryRepository repository; + private final RequestHistoryMapper requestMapper; + + @Override + public List getHistoryRecordsByUUID(String uuid) { + List history = repository.findAllByClientUUID(uuid); + Collections.sort(history); + return history; + } + + @Override + public void saveRequest(RequestHistoryDTO requestDTO) { + repository.save(requestMapper.requestHistoryDTOToRequestHistory(requestDTO)); + } +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java b/Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java deleted file mode 100644 index fc90cdd..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.r11.tools.utilis; - -import lombok.AllArgsConstructor; - -/** - * Enum of keys for redis database. - * @author Rafał Żukowicz - */ -@AllArgsConstructor -public enum BusinessKey { - INTERFACE_NAME("interfaceName"), - CLIENT_UUID("clientUUID"), - MESSAGE_ID("messageId"); - - private final String phrase; - - /** - * Returns string value of given enum variant - * @return string value of enum - */ - public String getReasonPhrase() { - return this.phrase; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java b/Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java deleted file mode 100644 index 0626848..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.r11.tools.utilis; - -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.Layout; -import ch.qos.logback.core.UnsynchronizedAppenderBase; -import com.cwbase.logback.AdditionalField; -import com.cwbase.logback.JSONEventLayout; -import java.time.LocalDate; -import java.util.Arrays; -import java.util.Iterator; -import org.apache.commons.pool2.impl.GenericObjectPoolConfig; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; -import redis.clients.jedis.Protocol; - -/** - * Class is used to insert logs directly to Redis. {@link com.release11.klaus.repository.EventRepositoryImpl} is using those logs. - * @author Rafał Żukowicz - * @author Gabriel Modzelewski - */ -public class RedisAppender extends UnsynchronizedAppenderBase { - - JedisPool pool; - JSONEventLayout jsonlayout; - Layout layout; - String host = "localhost"; - int port = Protocol.DEFAULT_PORT; - String key = null; - int timeout = Protocol.DEFAULT_TIMEOUT; - String password = null; - int database = Protocol.DEFAULT_DATABASE; - - public static final String LOG_PREFIX = "logstash_"; - - - public RedisAppender() { - jsonlayout = new JSONEventLayout(); - } - - /** - * Appends JedisPool by another log - * @param event object containing log info - */ - @Override - protected void append(ILoggingEvent event) { - Jedis client = pool.getResource(); - try { - String json = layout == null ? jsonlayout.doLayout(event) : layout.doLayout(event); - key = LOG_PREFIX + LocalDate.now(); - client.rpush(key, json); - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (client != null) { - client.close(); - } - } - } - - @Deprecated - public String getSource() { - return jsonlayout.getSource(); - } - - @Deprecated - public void setSource(String source) { - jsonlayout.setSource(source); - } - - @Deprecated - public String getSourceHost() { - return jsonlayout.getSourceHost(); - } - - @Deprecated - public void setSourceHost(String sourceHost) { - jsonlayout.setSourceHost(sourceHost); - } - - @Deprecated - public String getSourcePath() { - return jsonlayout.getSourcePath(); - } - - @Deprecated - public void setSourcePath(String sourcePath) { - jsonlayout.setSourcePath(sourcePath); - } - - @Deprecated - public String getTags() { - if (jsonlayout.getTags() != null) { - Iterator i = jsonlayout.getTags().iterator(); - StringBuilder sb = new StringBuilder(); - while (i.hasNext()) { - sb.append(i.next()); - if (i.hasNext()) { - sb.append(','); - } - } - return sb.toString(); - } - return null; - } - - @Deprecated - public void setTags(String tags) { - if (tags != null) { - String[] atags = tags.split(","); - jsonlayout.setTags(Arrays.asList(atags)); - } - } - - @Deprecated - public String getType() { - return jsonlayout.getType(); - } - - @Deprecated - public void setType(String type) { - jsonlayout.setType(type); - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public int getTimeout() { - return timeout; - } - - public void setTimeout(int timeout) { - this.timeout = timeout; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public int getDatabase() { - return database; - } - - public void setDatabase(int database) { - this.database = database; - } - - @Deprecated - public void setMdc(boolean flag) { - jsonlayout.setProperties(flag); - } - - @Deprecated - public boolean getMdc() { - return jsonlayout.getProperties(); - } - - @Deprecated - public void setLocation(boolean flag) { - jsonlayout.setLocationInfo(flag); - } - - @Deprecated - public boolean getLocation() { - return jsonlayout.getLocationInfo(); - } - - @Deprecated - public void setCallerStackIndex(int index) { - jsonlayout.setCallerStackIdx(index); - } - - @Deprecated - public int getCallerStackIndex() { - return jsonlayout.getCallerStackIdx(); - } - - @Deprecated - public void addAdditionalField(AdditionalField p) { - jsonlayout.addAdditionalField(p); - } - - public Layout getLayout() { - return layout; - } - - public void setLayout(Layout layout) { - this.layout = layout; - } - - /** - * Starts new instance of JedisPool - */ - @Override - public void start() { - super.start(); - GenericObjectPoolConfig config = new GenericObjectPoolConfig(); - config.setTestOnBorrow(true); - pool = new JedisPool(config, host, port, timeout, password, database); - } - - /** - * Stops and destroys JedisPool object - */ - @Override - public void stop() { - super.stop(); - pool.destroy(); - } - -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java b/Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java deleted file mode 100644 index 3f49400..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.r11.tools.utilis; - -import java.util.Map; -import org.slf4j.MDC; - -/** - * This static class has one purpose and one purpose only. It logs data about incomming requests. - * The data from logs is received via {@link com.release11.klaus.repository.EventRepositoryImpl} - * @author Rafał Żukowski - */ -public final class TrackingClient { - - /** - * Logs data inside the given map - * @param businessKeysMap map containing all the information about incomming request - */ - public static void setBusinessKeys(Map businessKeysMap){ - for (Map.Entry entry : businessKeysMap.entrySet()) { - MDC.put(entry.getKey().getReasonPhrase(), entry.getValue()); - } - } - - -} diff --git a/Backend/mocked-services/src/main/resources/application.properties b/Backend/mocked-services/src/main/resources/application.properties index bd52dd8..cc5394a 100644 --- a/Backend/mocked-services/src/main/resources/application.properties +++ b/Backend/mocked-services/src/main/resources/application.properties @@ -5,3 +5,12 @@ spring.mvc.view.suffix=.html logging.level.root=INFO logging.level.org.springframework.web=INFO logging.level.com.release11=INFO + +#database: +spring.redis.host=redis +spring.redis.port=6379 + +#retention +retention.minutes-to-delete-message=120 +retention.minutes-to-delete-history-record=1440 +retention.retention-cooldown=1440 diff --git a/Backend/mocked-services/src/main/resources/data-access.properties b/Backend/mocked-services/src/main/resources/data-access.properties deleted file mode 100644 index 27196b6..0000000 --- a/Backend/mocked-services/src/main/resources/data-access.properties +++ /dev/null @@ -1,2 +0,0 @@ -redis.host = redis -redis.port = 6379 \ No newline at end of file diff --git a/Backend/mocked-services/src/main/resources/logback.xml b/Backend/mocked-services/src/main/resources/logback.xml index 16733a7..1827e28 100644 --- a/Backend/mocked-services/src/main/resources/logback.xml +++ b/Backend/mocked-services/src/main/resources/logback.xml @@ -2,25 +2,8 @@ - - - redis - 6379 - logstash - - - - {"dateTimeStamp" : "%d{yyyy-MM-dd}T%d{HH:mm:ss}", "eventId":"%X{eventId}", "interfaceName":"%X{interfaceName}", "clientUUID":"%X{clientUUID}", "messageId":"%X{messageId}", "thread":"%t","level":"%-5level", "message":"%msg"}%n - - - - - - - ${HOME_LOG} - logs/mockServices.%d{yyyy-MM-dd}.%i.log 10MB @@ -34,7 +17,6 @@ - diff --git a/Backend/mocked-services/src/main/resources/static/js/datatransfer.js b/Backend/mocked-services/src/main/resources/static/js/datatransfer.js deleted file mode 100644 index ba21743..0000000 --- a/Backend/mocked-services/src/main/resources/static/js/datatransfer.js +++ /dev/null @@ -1,541 +0,0 @@ -var clientUUID = ''; -var advancedDisplayed = false; -var json = {}; -var jsonIndex = 0; -var lastId = 1; -var htable_row = 0; -var host = getDomain(); -var dataModified = false; -const addMessageName = 'addMessage'; -const loadMessageName = 'changeMessage'; -const removeMessageName = 'removeMessage'; - -const C_UUID = 'mock-uuid'; -const C_ID = 'last-displayed-id'; -const C_ADV = 'advanced-mode'; - -const color_red = "#ff8f8f"; -const color_grey = "#6b6b6b"; - -const setModified = function(){ - setDataModified(); -} -const setOrigin = function(){ - setDataOrigin(); -} - -const getUpdate = function(){ - updateData(); -} -const dataRefresh = function(){ - getData(); -} -$('#btn-newtile').click(function(){callAddMessage()}); -// $('#btn-addRow').click(function(){addRow()}); -// $('#btn-save').click(getUpdate); - -function getData(){ - $.getJSON(host + '/api/mock/'+clientUUID, function(data) { - json = data; - checkUuid(); - - - refreshData(); - }); -} - - -function checkUuid(){ - if(clientUUID == null || clientUUID == undefined || clientUUID == ''){ - clientUUID = json[0].clientUUID; - setCookie(); - } -} - -function getDomain(){ - var url = window.location.href; - var arr = url.split("/"); - var result = arr[0] + "//" + arr[2]; - return result; -} - -function httpStatusInvalid(){ - value = $('#httpStatus').val(); - return value == ''; -} - -function setDataModified(){ - if(httpStatusInvalid()){ - $('#btn-save').removeClass('active'); - $('#btn-save').off(); - document.getElementById("httpStatus").style.backgroundColor = color_red; - return; - } - dataModified = true; - $('#btn-save').addClass('active'); - $('#btn-save').click(getUpdate); - document.getElementById("httpStatus").style.backgroundColor = null; -} - -//Adding change listener to fields -$('.data-field').change(setModified); - -function setDataOrigin(){ - dataModified = false; - $('#btn-save').removeClass('active'); - $('#btn-save').off(); -} - -const idToDisplay = function(){ - let defaultId = json[0].mockedResponseId; - if(lastId == undefined || lastId == null) return defaultId; - for(let i=0; i 0){ - jsonIndex -= 1; - return json[jsonIndex].mockedResponseId; - } - return defaultId; -} - -function refreshData(){ - $("#uuid-input").val(clientUUID); - fillMessageList(); - - let id = idToDisplay(); - - loadMessage(id); - -} - -function setCookie(){ - document.cookie = C_UUID + '=' +clientUUID; - document.cookie = C_ID + '=' + lastId; - document.cookie = C_ADV + '=' + advancedVisibility; -} - -function loadCookies(){ - clientUUID = getCookie(C_UUID); - lastId = getCookie(C_ID); - advancedDisplayed = getCookie(C_ADV) == 'true'; -} - -function getCookie(cname) { - var name = cname + '='; - var decodedCookie = decodeURIComponent(document.cookie); - var ca = decodedCookie.split(';'); - for(var i = 0; i '+link+''; - $('#messageLink').html(linkHtml); - $('#httpStatus').val(httpStatus); - $('#uuid-input').val(uuid); - $('#typeSelector').val(mediaType); - $('#bodyEditor').val(body); - $('#mockedMessageId').html(id); - -} - -function changeEditionOfUUID(element){ - - var inputFieldId= "#uuid-input" - var inputFieldDiv = "#uuid-edit-field" - if(element.checked){ - $(inputFieldId).removeAttr('disabled'); - $(inputFieldDiv).removeClass('disabled'); - } else{ - $(inputFieldId).attr('disabled', true); - $(inputFieldDiv).addClass('disabled'); - } -} - -function copyUUIDToClipboard(){ - navigator.clipboard.writeText( document.getElementById('uuid-input').value ); -} - - -async function fetchUUIDCheck(givenUUID , strategy){ - var newUUID = "UUID" ; - url = host + "/api/mock/check/"; - - switch(strategy){ - case "new":{ - await fetch(url + givenUUID+ "/", { method : "GET" }) - .then ( response => response.text() ) - .then ( data => { - newUUID = data; - - } ) - break; - } - case "restore":{ - await fetch(url + givenUUID + "/" + clientUUID + "/" , { method: "GET" }) - .then (response => response.text() ) - .then (data => { - newUUID = data; - - } ) - break; - } - } - return newUUID ; -} - -function checkUUIDChars(uuid) { - uuid.replace(/ /g,'') - const regex = new RegExp("^[A-z0-9-]+$"); - - if(regex.test(uuid) && uuid != ""){ - return uuid ; - } - return "invalid"; - } - -function changeUUID(element){ - - const uuidStrategy = $('input[name="uuid-validation-type"]:checked').val(); - const givenUUID = checkUUIDChars(element.value); - - if( givenUUID == clientUUID ){ - $("#uuid-input").attr("disabled", true); - uuidChangeModalDisplay("noChg"); - return; - } - - var newUUID = fetchUUIDCheck(givenUUID , uuidStrategy); - var changeMessage = uuidStrategy; - newUUID - .then( data => { - if (givenUUID == data) { - changeMessage = "success"; - } - clientUUID = data; - $("#editable").attr("checked", false); - - uuidChangeModalDisplay(changeMessage); - document.cookie = C_UUID + '=' + data ; - } ) - loadCookies(); - refreshData(); -} - - -function createLink(uuid, id){ - var link = host + '/api/mock/r/'+uuid+'/'+id; - return link; -} - -function fillHeaderTable(headers){ - var innerHTML = buildHeaderMapHtml(headers); - refreshHeaderTable(innerHTML); -} - -function refreshHeaderTable(html){ - $('#headerMapTable').html(html); - $('.table-map').change(function(){setDataModified()}); - $('.btn-hashmap').click(function(){ - $(this).closest('tr').remove(); - setDataModified(); - }) -} - -function buildHeaderMapHtml(headers){ - var innerHTML = ''; - for(var key in headers){ - innerHTML += buildRowHtml(key, headers[key]); - } - return innerHTML; -} - -function addRow(key, value){ - var headerMap = $('#headerMapTable'); - var headersMapHtml = headerMap.html(); - headersMapHtml += buildRowHtml(key, value); - refreshHeaderTable(headersMapHtml); -} - -const newRowInput = function(){ - const hName = $('#headerKeyInput'); - const hValue = $('#headerValueInput'); - if(checkIfInputValid(hName.val()) && checkIfInputValid(hValue.val())){ - addRow(hName.val(), hValue.val()); - hName.val(null); - hValue.val(null); - setDataModified(); - } -} - -$('#btn-newRow').click(newRowInput); - -function checkIfInputValid(input){ - return !(input == '' || input == null || input == undefined); -} - -function checkIfHeaderEssential(key){ - - if( key == "Connection" || key == "Keep-Alive" || key == "Date" ){ - return true; - } - return false; - -} - -function buildRowHtml(key, value){ - - if(checkIfHeaderEssential(key)){ - return '' + - '' + - '' + - '' + - ''; - } - return '' + - '' + - '' + - '' + - '' + - ''; -} - - -function fillMessageList(){ - $("#listItems").html(''); - var innerHTML = ''; - for(let i=0; i' + - '
' + - '
' + - '
' + - '

Id: ' + id + '

' + - '

Status: ' + httpStatus + '

' + - '
' + - '
' + - '' + - '
' + - '
' + - '
' + - ''; - return innerHTML; -} - - - -const onbuild = function(){ - loadCookies(); - getData(); - if(advancedDisplayed) { - changeAdvancedVisibility(); - } -} - -$(document).ready(onbuild); - -function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - - - -function generateJson(){ - var newJson = - { - clientUUID: json[jsonIndex].clientUUID, - mockedResponseId: json[jsonIndex].mockedResponseId, - mediaType: $('#typeSelector').val(), - messageBody: $('#bodyEditor').val(), - httpStatus: $('#httpStatus').val(), - httpHeaders: {}, - }; - newJson['httpHeaders'] = convertTableToJson(); - - json[jsonIndex] = newJson; - return newJson; -} - - -function convertTableToJson(){ - const rows = $('#headerMapTable').children(); - - var obj = {}; - var key; - for(let i=0; i' + - '' + historyJson[i].dateTimeStamp + '' + - '' + historyJson[i].interfaceName + '' + - ''; - } - return innerHTML; -} - -function displayHistory(){ - $('#historyTable tbody').html(historyToHtml()); -} diff --git a/Backend/mocked-services/src/main/resources/static/js/uianimation.js b/Backend/mocked-services/src/main/resources/static/js/uianimation.js deleted file mode 100644 index 46dfb20..0000000 --- a/Backend/mocked-services/src/main/resources/static/js/uianimation.js +++ /dev/null @@ -1,141 +0,0 @@ -var advancedVisibility = false; -var selectMenu = $("#selectMenuContent"); -var advancedTab = $("#advanced"); -var basicID = $("#basicItemData") -var advancedID = $("#advancedItemData"); -var advancedUUIDOptions = $("#uuid-validation-strategy"); -var focusedField = false; -function changeAdvancedVisibility(){ - if(advancedVisibility){ - selectMenu.removeClass('active'); - advancedTab.removeClass('active'); - advancedID.removeClass('active'); - advancedUUIDOptions.removeClass('active'); - basicID.addClass('active'); - advancedVisibility = false; - } - else { - selectMenu.addClass('active'); - advancedTab.addClass('active'); - advancedID.addClass('active'); - advancedUUIDOptions.addClass('active'); - basicID.removeClass('active'); - advancedVisibility = true; - } - setCookie(); -} - -const historyFilter = $('#history-filter'); -const historyFilterSwitch = function(){ - historyFilter.toggleClass('active'); -} - -$("#optional").click(changeAdvancedVisibility); -$('#historyTab').click(showHistory); -$('#btn-history-filter').click(historyFilterSwitch); - - - -const tabitem = $('.tabitem'); -function showHistory(){ - $('#headersTab').click(showHeaders); - tabitem.removeClass('active'); - $('.tabcontent').removeClass('active'); - $('#history').addClass('active'); - $('#historyTab').addClass('active'); - $('#historyTab').off('click'); - initializeHistory(); -} - -function initializeHistory(){ - historyFilter.removeClass('active'); - getLast24hHistoryData(); -} - - - -function showHeaders(){ - $('#historyTab').click(showHistory); - tabitem.removeClass('active'); - $('.tabcontent').removeClass('active'); - $('#headers').addClass('active'); - $('#headersTab').addClass('active'); - $('#headersTab').off('click'); -} - -function focusInTip(element){ - showTip(element); - focusedField = true; -} - -function focusOutTip(element){ - focusedField = false; - hidTip(element); -} - -function hidTip(element){ - if(focusedField) return; - $('#'+element).removeClass('active'); -} - -function showTip(element){ - if(focusedField) return; - $('.tip').removeClass('active'); - $('#'+element).addClass('active'); -} - -$('#messageLink').mouseover(function(){showTip('messageLinkTip')}); -$('#messageLink').mouseleave(function(){hidTip('messageLinkTip')}); - -$('#httpStatus').mouseover(function(){showTip('httpStatusTip')}); -$('#httpStatus').focusin(function(){focusInTip('httpStatusTip')}); -$('#httpStatus').mouseleave(function(){hidTip('httpStatusTip')}); -$('#httpStatus').focusout(function(){focusOutTip('httpStatusTip')}); - -$('#typeSelector').mouseover(function(){showTip('typeSelectorTip')}); -$('#typeSelector').focusin(function(){focusInTip('typeSelectorTip')}); -$('#typeSelector').mouseleave(function(){hidTip('typeSelectorTip')}); -$('#typeSelector').focusout(function(){focusOutTip('typeSelectorTip')}); - -$('#bodyEditor').mouseover(function(){showTip('bodyEditorTip')}); -$('#bodyEditor').focusin(function(){focusInTip('bodyEditorTip')}); -$('#bodyEditor').mouseleave(function(){hidTip('bodyEditorTip')}); -$('#bodyEditor').focusout(function(){focusOutTip('bodyEditorTip')}); - -$('#headersTab').mouseover(function(){showTip('headersTabTip')}); -$('#headersTab').mouseleave(function(){hidTip('headersTabTip')}); - -$('#historyTab').mouseover(function(){showTip('historyTabTip')}); -$('#historyTab').mouseleave(function(){hidTip('historyTabTip')}); - -$('#headerKeyInput').mouseover(function(){showTip('newHeaderTip')}); -$('#headerKeyInput').focusin(function(){focusInTip('newHeaderTip')}); -$('#headerKeyInput').mouseleave(function(){hidTip('newHeaderTip')}); -$('#headerKeyInput').focusout(function(){focusOutTip('newHeaderTip')}); - -$('#headerValueInput').mouseover(function(){showTip('newHeaderTip')}); -$('#headerValueInput').focusin(function(){focusInTip('newHeaderTip')}); -$('#headerValueInput').mouseleave(function(){hidTip('newHeaderTip')}); -$('#headerValueInput').focusout(function(){focusOutTip('newHeaderTip')}); - -$('#btnSave').mouseover(function(){showTip('btnSaveTip');}); -$('#btnSave').focusin(function(){focusInTip('btnSaveTip')}); -$('#btnSave').mouseleave(function(){hidTip('btnSaveTip')}); -$('#btnSave').focusout(function(){focusOutTip('btnSaveTip')}); - -$('#new-tile').mouseover(function(){showTip('btn-newTileTip');}); -$('#new-tile').mouseleave(function(){hidTip('btn-newTileTip')}); -$('#new-tile').focusout(function(){focusOutTip('btn-newTileTip')}); - -$('#listItems').mouseover(function(){showTip('messagesTip');}); -$('#listItems').mouseleave(function(){hidTip('messagesTip')}); - - -$('#uuid-edit-field').mouseover(function(){ showTip('UUIDFieldTip') }); -$('#uuid-edit-field').mouseleave(function(){ hidTip('UUIDFieldTip') }); - -$('#uuid-validation-strategy').mouseover(function(){ showTip('UUIDValidationStrategyTip') }); -$('#uuid-validation-strategy').mouseleave(function(){ hidTip('UUIDValidationStrategyTip') }); - -$('#editableBlock').mouseover( function(){ showTip('UUIDEditionTip') } ); -$('#editableBlock').mouseleave(function(){ hidTip('UUIDEditionTip') }); \ No newline at end of file diff --git a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java index cee98f2..58149be 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java @@ -8,6 +8,9 @@ import com.r11.tools.controller.XPathController; import com.r11.tools.controller.XsdController; import com.r11.tools.controller.XsltController; import com.r11.tools.controller.internal.RestControllerRegistry; +import com.r11.tools.xml.Saxon; +import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import spark.Spark; @@ -35,12 +38,15 @@ public class SparkApplication { Gson jsongson = new GsonBuilder() .disableHtmlEscaping() .create(); + XmlEngine saxon = new Saxon(); + XmlEngine xalan = new Xalan(); + RestControllerRegistry registry = new RestControllerRegistry(); - registry.registerController(new ProcessorInfoController(logger)); - registry.registerController(new XsdController(gson, logger)); - registry.registerController(new XPathController(gson, logger)); - registry.registerController(new XsltController(gson, logger)); + registry.registerController(new ProcessorInfoController(logger, saxon, xalan)); + registry.registerController(new XsdController(gson, logger, xalan)); + registry.registerController(new XPathController(gson, logger, saxon, xalan)); + registry.registerController(new XsltController(gson, logger, saxon, xalan)); registry.registerController(new JsonController(gson, jsongson, logger)); registry.register(); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java index 8574c3b..e42f277 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java @@ -1,8 +1,7 @@ package com.r11.tools.controller; -import com.google.gson.Gson; +import com.google.gson.*; //import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; import com.r11.tools.controller.internal.GlobalControllerManifest; import com.r11.tools.controller.internal.HandlerType; import com.r11.tools.controller.internal.RestController; @@ -11,6 +10,9 @@ import spark.Request; import spark.Response; import org.apache.logging.log4j.Logger; +import java.util.List; +import java.util.Map; + @GlobalControllerManifest(path = "/json") public class JsonController implements RestController { @@ -32,9 +34,7 @@ public class JsonController implements RestController { JsonObject responseJson = new JsonObject(); try { - JsonObject requestJson = this.gson.fromJson(request.body(), JsonObject.class); - - response.status(200); + Object requestJson = this.gson.fromJson(request.body(), Object.class); responseJson.addProperty("data", this.prettyGson.toJson(requestJson)); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); @@ -61,7 +61,7 @@ public class JsonController implements RestController { JsonObject responseJson = new JsonObject(); try { - JsonObject requestJson = this.prettyGson.fromJson(request.body(), JsonObject.class); + Object requestJson = this.prettyGson.fromJson(request.body(), Object.class); response.status(200); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java index 2a8333c..a926345 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java @@ -5,6 +5,7 @@ import com.r11.tools.controller.internal.HandlerType; import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import com.r11.tools.xml.Saxon; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -13,9 +14,13 @@ import spark.Response; public class ProcessorInfoController implements RestController { private final Logger logger; + private final XmlEngine saxon; + private final XmlEngine xalan; - public ProcessorInfoController(Logger logger) { + public ProcessorInfoController(Logger logger, XmlEngine saxon, XmlEngine xalan) { this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } /** @@ -24,8 +29,8 @@ public class ProcessorInfoController implements RestController { @ScopedControllerManifest(method = HandlerType.GET, path = "/procinfo") public void processorInfo(Request request, Response response) { try { - response.header("processor", "Saxon " + Saxon.getVersion() + " over s9api"); - response.body(Saxon.getVersion()); + response.header("processor", "Saxon " + saxon.getVersion() + " over s9api"); + response.body(saxon.getVersion()); } catch (Exception ex) { this.logger.error("Error on retrieving engine version. " + ex); response.body(ex.getMessage()); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java index a3d0ca2..a188566 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java @@ -3,8 +3,7 @@ package com.r11.tools.controller; import com.google.gson.Gson; import com.google.gson.JsonObject; import com.r11.tools.controller.internal.*; -import com.r11.tools.xml.Saxon; -import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -15,9 +14,14 @@ public class XPathController implements RestController { private final Gson gson; private final Logger logger; - public XPathController(Gson gson, Logger logger) { + private final XmlEngine saxon; + private final XmlEngine xalan; + + public XPathController(Gson gson, Logger logger, XmlEngine saxon, XmlEngine xalan) { this.gson = gson; this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } @ScopedControllerManifest(method = HandlerType.POST, path = "/xpath") @@ -44,10 +48,6 @@ public class XPathController implements RestController { String processor = requestJson.get("processor").getAsString(); String version = requestJson.get("version").getAsString(); - String tmp = ""; - long timeStart; - long duration; - if (processor == null) { response.body("saxon, xalan"); return; @@ -56,65 +56,77 @@ public class XPathController implements RestController { JsonObject responseJson = new JsonObject(); switch (processor) { case "saxon": - response.header("processor", "Saxon " + Saxon.getVersion() + " " + version + " over s9api"); - timeStart = System.currentTimeMillis(); - - try { - tmp = Saxon.processXPath(data, query, version).getData().trim(); - - response.status(200); - - responseJson.addProperty("result", tmp); - responseJson.addProperty("status", "OK"); - } catch (Exception ex) { - this.logger.error("Error on processing XPath using Saxon. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms."); - - responseJson.addProperty("processor", "Saxon " + Saxon.getVersion() + " " + version + " over s9api"); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); - return; - + processWithSaxon(response, data, query, version, responseJson); + break; case "xalan": - response.header("processor", Xalan.getVersion()); - timeStart = System.currentTimeMillis(); - - try { - XPathQueryResult xPathQueryResult = Xalan.processXPath(data, query); - - response.status(200); - - responseJson.addProperty("result", xPathQueryResult.getData().trim()); - responseJson.addProperty("status", "OK"); - responseJson.addProperty("type", xPathQueryResult.getType()); - } catch (Exception ex) { - this.logger.error("Error on processing XPath using Xalan. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms."); - - responseJson.addProperty("processor", Xalan.getVersion()); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); - return; + processWithXalan(response, data, query, responseJson); + break; default: response.body("saxon, xalan"); } } + + private void processWithXalan(Response response, String data, String query, JsonObject responseJson) { + long timeStart; + long duration; + response.header("processor", xalan.getVersion()); + timeStart = System.currentTimeMillis(); + + try { + XPathQueryResult xPathQueryResult = xalan.processXPath(data, query, ""); + + response.status(200); + + responseJson.addProperty("result", xPathQueryResult.getData().trim()); + responseJson.addProperty("status", "OK"); + responseJson.addProperty("type", xPathQueryResult.getType()); + } catch (Exception ex) { + this.logger.error("Error on processing XPath using Xalan. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms."); + + responseJson.addProperty("processor", xalan.getVersion()); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } + + private void processWithSaxon(Response response, String data, String query, String version, JsonObject responseJson) { + long timeStart; + String tmp; + long duration; + response.header("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); + timeStart = System.currentTimeMillis(); + + try { + tmp = saxon.processXPath(data, query, version).getData().trim(); + + response.status(200); + + responseJson.addProperty("result", tmp); + responseJson.addProperty("status", "OK"); + } catch (Exception ex) { + this.logger.error("Error on processing XPath using Saxon. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms."); + + responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java index f14e9da..3a04ce6 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java @@ -7,6 +7,7 @@ import com.r11.tools.controller.internal.HandlerType; import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -17,9 +18,12 @@ public class XsdController implements RestController { private final Gson gson; private final Logger logger; - public XsdController(Gson gson, Logger logger) { + private final XmlEngine xalan; + + public XsdController(Gson gson, Logger logger, XmlEngine xalan) { this.gson = gson; this.logger = logger; + this.xalan = xalan; } @ScopedControllerManifest(method = HandlerType.POST, path = "/xsd") @@ -44,14 +48,14 @@ public class XsdController implements RestController { String data = requestJson.get("data").getAsString(); String xsd = requestJson.get("process").getAsString(); - response.header("processor", Xalan.getVersion()); + response.header("processor", xalan.getVersion()); long timeStart = System.currentTimeMillis(); String tmp; JsonObject responseJson = new JsonObject(); try { - tmp = Xalan.validate(data, xsd).trim(); + tmp = xalan.validate(data, xsd).trim(); response.status(200); @@ -69,7 +73,7 @@ public class XsdController implements RestController { long duration = System.currentTimeMillis() - timeStart; this.logger.info("Request (XSD, Xalan) processed in " + duration + " ms."); - responseJson.addProperty("processor", Xalan.getVersion()); + responseJson.addProperty("processor", xalan.getVersion()); responseJson.addProperty("time", duration); response.body(this.gson.toJson(responseJson)); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java index 6159456..29e0fd6 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java @@ -8,6 +8,7 @@ import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import com.r11.tools.xml.Saxon; import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -18,9 +19,14 @@ public class XsltController implements RestController { private final Gson gson; private final Logger logger; - public XsltController(Gson gson, Logger logger) { + private final XmlEngine saxon; + private final XmlEngine xalan; + + public XsltController(Gson gson, Logger logger, XmlEngine saxon, XmlEngine xalan) { this.gson = gson; this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } @ScopedControllerManifest(method = HandlerType.POST, path = "/xslt") @@ -51,69 +57,78 @@ public class XsltController implements RestController { response.body("saxon, xalan"); return; } - - String tmp; - long timeStart; - long duration; - JsonObject responseJson = new JsonObject(); switch (processor) { case "saxon": - timeStart = System.currentTimeMillis(); - try { - tmp = Saxon.processXSLT(data, query); - - response.status(200); - - responseJson.addProperty("result", tmp); - responseJson.addProperty("status", "OK"); - } catch (Exception ex) { - this.logger.error("Error on processing XSLT using Saxon. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XSLT, Saxon) processed in " + duration + " ms."); - - responseJson.addProperty("processor", "Saxon " + Saxon.getVersion() + " " + version); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); + processWithSaxon(response, data, query, version, responseJson); return; case "xalan": - timeStart = System.currentTimeMillis(); - try { - tmp = Xalan.processXSLT(data, query); - - response.status(200); - - responseJson.addProperty("result", tmp); - responseJson.addProperty("status", "OK"); - } catch (Exception ex) { - this.logger.error("Error on processing XSLT using Xalan. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XSLT, Xalan) processed in " + duration + " ms."); - - responseJson.addProperty("processor", Xalan.getVersion()); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); + processWithXalan(response, data, query, responseJson); return; default: response.body("saxon, xalan"); } } + + private void processWithXalan(Response response, String data, String query, JsonObject responseJson) { + long duration; + long timeStart; + String tmp; + timeStart = System.currentTimeMillis(); + try { + tmp = xalan.processXSLT(data, query); + + response.status(200); + + responseJson.addProperty("result", tmp); + responseJson.addProperty("status", "OK"); + } catch (Exception ex) { + this.logger.error("Error on processing XSLT using Xalan. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XSLT, Xalan) processed in " + duration + " ms."); + + responseJson.addProperty("processor", xalan.getVersion()); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } + + private void processWithSaxon(Response response, String data, String query, String version, JsonObject responseJson) { + long duration; + String tmp; + long timeStart; + timeStart = System.currentTimeMillis(); + try { + tmp = saxon.processXSLT(data, query); + + response.status(200); + + responseJson.addProperty("result", tmp); + responseJson.addProperty("status", "OK"); + } catch (Exception ex) { + this.logger.error("Error on processing XSLT using Saxon. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XSLT, Saxon) processed in " + duration + " ms."); + + responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java index 4cb2835..f9f330b 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java @@ -11,7 +11,7 @@ import java.io.StringWriter; * Handler for Saxon engine * @author Wojciech Czop */ -public class Saxon { +public class Saxon implements XmlEngine{ /** * Transforms string containing xml document via xslt @@ -20,7 +20,7 @@ public class Saxon { * @return transformed xml * @throws SaxonApiException thrown on stylesheet or transformation errors */ - public static String processXSLT(String data, String transform) throws SaxonApiException { + public String processXSLT(String data, String transform) throws SaxonApiException { Processor processor = new Processor(false); XsltCompiler compiler = processor.newXsltCompiler(); XsltExecutable stylesheet = compiler.compile(new StreamSource(new StringReader(transform))); @@ -34,6 +34,11 @@ public class Saxon { return sw.toString(); } + @Override + public String validate(String data, String xsd) { + throw new UnsupportedOperationException(); + } + /** * Process xpath and return either node or wrapped atomic value * @param data xml to be querried @@ -42,7 +47,7 @@ public class Saxon { * @return string xml representation of the node * @throws Exception thrown on node building errors or invalid xpath */ - public static XPathQueryResult processXPath(String data, String query, String version) throws Exception { + public XPathQueryResult processXPath(String data, String query, String version) throws Exception { Processor p = new Processor(false); XPathCompiler compiler = p.newXPathCompiler(); DocumentBuilder builder = p.newDocumentBuilder(); @@ -70,7 +75,7 @@ public class Saxon { * Returns version of the processor * @return version of the processor */ - public static String getVersion() { + public String getVersion() { return new Processor(false).getSaxonProductVersion(); } } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java index 1caad08..51ad04f 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java @@ -24,7 +24,7 @@ import java.io.*; * Handler for Xalan engine * @author Wojciech Czop */ -public class Xalan { +public class Xalan implements XmlEngine{ /** * Transforms string containing xml document via xslt @@ -33,7 +33,7 @@ public class Xalan { * @return transformed xml * @throws Exception thrown on stylesheet or transformation errors */ - public static String processXSLT(String data, String transform) throws Exception{ + public String processXSLT(String data, String transform) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(data))); @@ -51,7 +51,7 @@ public class Xalan { return sw.toString(); } - private static boolean isTextNode(Node n) { + private boolean isTextNode(Node n) { if (n == null) return false; short nodeType = n.getNodeType(); @@ -65,7 +65,7 @@ public class Xalan { * @return xml processed using given xpath * @throws Exception thrown on node building errors or invalid xpath */ - public static XPathQueryResult processXPath(String data, String transform) throws Exception { + public XPathQueryResult processXPath(String data, String transform, String version) throws Exception { // Set up a DOM tree to query. InputSource in = new InputSource(new StringReader(data)); @@ -103,7 +103,7 @@ public class Xalan { return new XPathQueryResult(resultString.toString(), "node"); } catch (TransformerException e) { String returnData = XPathAPI.eval(doc, transform).toString(); - return new XPathQueryResult(data, "string"); + return new XPathQueryResult(returnData, "string"); } } @@ -112,7 +112,7 @@ public class Xalan { * Returns version of the processor * @return version of the processor */ - public static String getVersion(){ + public String getVersion(){ return org.apache.xalan.Version.getVersion(); } @@ -123,7 +123,7 @@ public class Xalan { * @return statement of validity * @throws Exception thrown on invalid xsd schema or xml */ - public static String validate(String data, String xsd) throws Exception{ + public String validate(String data, String xsd) throws Exception { Source dataSource = new StreamSource(new StringReader(data)); Source xsdSource = new StreamSource(new StringReader(xsd)); SchemaFactory schemaFactory = SchemaFactory diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java new file mode 100644 index 0000000..5742073 --- /dev/null +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java @@ -0,0 +1,12 @@ +package com.r11.tools.xml; + +import com.r11.tools.controller.internal.XPathQueryResult; + +public interface XmlEngine { + XPathQueryResult processXPath(String data, String query, String version) throws Exception; + String processXSLT(String data, String transform) throws Exception; + String validate(String data, String xsd) throws Exception; + + public String getVersion(); + +} diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile index 58fdcd5..4e9751f 100644 --- a/Frontend/Dockerfile +++ b/Frontend/Dockerfile @@ -1,5 +1,8 @@ FROM nginx:stable-alpine +RUN apk add --no-cache tzdata +ENV TZ Europe/Warsaw + COPY ./tools/ /usr/share/nginx/html/tools/ COPY ./lawful/ /usr/share/nginx/html/lawful/ COPY ./assets/ /usr/share/nginx/html/assets/ diff --git a/Frontend/assets/css/frame.css b/Frontend/assets/css/frame.css index 70d0b07..c6a6ba2 100644 --- a/Frontend/assets/css/frame.css +++ b/Frontend/assets/css/frame.css @@ -41,7 +41,7 @@ div#header { grid-column: 1; } -iframe#frame { +iframe#iframe { flex-grow: 1; background-color: #FFFFFF; } diff --git a/Backend/mocked-services/src/main/resources/static/css/common.css b/Frontend/assets/css/tools/mock/common.css similarity index 93% rename from Backend/mocked-services/src/main/resources/static/css/common.css rename to Frontend/assets/css/tools/mock/common.css index 350f678..f814529 100644 --- a/Backend/mocked-services/src/main/resources/static/css/common.css +++ b/Frontend/assets/css/tools/mock/common.css @@ -6,6 +6,8 @@ @import url('r11tooltip.css'); @import url('r11modal.css'); @import url('r11flexbox.css'); +@import url('r11popup.css'); +@import url('../../highlight.css'); @font-face { font-family: 'Material Icons'; diff --git a/Backend/mocked-services/src/main/resources/static/css/font/Material-Icons.woff2 b/Frontend/assets/css/tools/mock/font/Material-Icons.woff2 similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/Material-Icons.woff2 rename to Frontend/assets/css/tools/mock/font/Material-Icons.woff2 diff --git a/Backend/mocked-services/src/main/resources/static/css/font/Nunito-VariableFont_wght.ttf b/Frontend/assets/css/tools/mock/font/Nunito-VariableFont_wght.ttf similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/Nunito-VariableFont_wght.ttf rename to Frontend/assets/css/tools/mock/font/Nunito-VariableFont_wght.ttf diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.eot b/Frontend/assets/css/tools/mock/font/fontello.eot similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.eot rename to Frontend/assets/css/tools/mock/font/fontello.eot diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.svg b/Frontend/assets/css/tools/mock/font/fontello.svg similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.svg rename to Frontend/assets/css/tools/mock/font/fontello.svg diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.ttf b/Frontend/assets/css/tools/mock/font/fontello.ttf similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.ttf rename to Frontend/assets/css/tools/mock/font/fontello.ttf diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.woff b/Frontend/assets/css/tools/mock/font/fontello.woff similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.woff rename to Frontend/assets/css/tools/mock/font/fontello.woff diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.woff2 b/Frontend/assets/css/tools/mock/font/fontello.woff2 similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.woff2 rename to Frontend/assets/css/tools/mock/font/fontello.woff2 diff --git a/Backend/mocked-services/src/main/resources/static/css/fontello.css b/Frontend/assets/css/tools/mock/fontello.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/fontello.css rename to Frontend/assets/css/tools/mock/fontello.css diff --git a/Backend/mocked-services/src/main/resources/static/css/main.css b/Frontend/assets/css/tools/mock/main.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/main.css rename to Frontend/assets/css/tools/mock/main.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11addons.css b/Frontend/assets/css/tools/mock/r11addons.css similarity index 73% rename from Backend/mocked-services/src/main/resources/static/css/r11addons.css rename to Frontend/assets/css/tools/mock/r11addons.css index 94db8ae..2d2e72e 100644 --- a/Backend/mocked-services/src/main/resources/static/css/r11addons.css +++ b/Frontend/assets/css/tools/mock/r11addons.css @@ -69,4 +69,27 @@ .content p { margin: 0; padding: 0; -} \ No newline at end of file +} + +.refresh-button{ + float: right; + border: none; + background-color: unset; + font-size: xx-large; +} + +.refresh-button:hover{ + animation-name: rotation; + animation-duration: 0.8s; + animation-iteration-count: infinite; + animation-timing-function: linear; +} + +@keyframes rotation{ + from{ + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } \ No newline at end of file diff --git a/Backend/mocked-services/src/main/resources/static/css/r11flexbox.css b/Frontend/assets/css/tools/mock/r11flexbox.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11flexbox.css rename to Frontend/assets/css/tools/mock/r11flexbox.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11modal.css b/Frontend/assets/css/tools/mock/r11modal.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11modal.css rename to Frontend/assets/css/tools/mock/r11modal.css diff --git a/Frontend/assets/css/tools/mock/r11popup.css b/Frontend/assets/css/tools/mock/r11popup.css new file mode 100644 index 0000000..296349a --- /dev/null +++ b/Frontend/assets/css/tools/mock/r11popup.css @@ -0,0 +1,83 @@ +.popup-flex:not(.hiddable-container){ + animation: blur 0.5s ease-in-out ; + animation-fill-mode: forwards; +} +.popup-flex{ + display: flex; + align-items: center; + width: 100%; + height: 100%; + z-index: 50; + flex-direction: column; + gap: 2%; + position: fixed; + justify-content: center; +} + +.popup-body{ + min-width: 33%; + max-width: 60%; + max-height: 70%; + background-color: white; + box-shadow: 10px 10px 5px lightblue; + min-height: 45%; + border-radius: 1em; + text-align: center; + padding: 10px 15px 15px 15px; + color: black; + border: 1px #2A93B0 solid; + display: flex; + flex-direction: column; + position: fixed; +} + +.popup-button-close-container{ + text-align: right; + margin-right: 2%; + margin-top: 1%; + font-size: xx-large; + font-weight: bold; + position: sticky; + top:0 +} + +.hiddable-popup-option{ + flex-grow: 1; + overflow: auto; + padding: 1.5%; +} + +.popup-button-close{ + background: padding-box; + border: 0; +} + +.popup-button-close:hover{ + color: #2A93B0; +} + +.hiddable-container{ + display:none; +} + +.hidden-popup-type{ + display: none; +} + +#history-request-body{ + text-align: justify; +} + +@keyframes blur { + 0% { + backdrop-filter: blur(0px); + } + + 50% { + backdrop-filter: blur(5px); + } + + 100% { + backdrop-filter: blur(10px); + } + } diff --git a/Backend/mocked-services/src/main/resources/static/css/r11tables.css b/Frontend/assets/css/tools/mock/r11tables.css similarity index 77% rename from Backend/mocked-services/src/main/resources/static/css/r11tables.css rename to Frontend/assets/css/tools/mock/r11tables.css index 0a680ab..c78730b 100644 --- a/Backend/mocked-services/src/main/resources/static/css/r11tables.css +++ b/Frontend/assets/css/tools/mock/r11tables.css @@ -68,4 +68,29 @@ background-color: #3bc4f1; text-align: left; color: white; +} + +.table-default td{ + text-align: center; +} + +#header-table tr td { + border: 1px black solid; + padding: 1.5%; + +} + +#header-table{ + border-collapse: collapse; + width: 100%; + height: 100%; +} + +.history-header-name{ + min-width: 10vw; +} + +#historyTable, td{ + padding: 1%; + overflow-x: scroll; } \ No newline at end of file diff --git a/Backend/mocked-services/src/main/resources/static/css/r11tool.css b/Frontend/assets/css/tools/mock/r11tool.css similarity index 98% rename from Backend/mocked-services/src/main/resources/static/css/r11tool.css rename to Frontend/assets/css/tools/mock/r11tool.css index 9368b0b..098cfe0 100644 --- a/Backend/mocked-services/src/main/resources/static/css/r11tool.css +++ b/Frontend/assets/css/tools/mock/r11tool.css @@ -21,6 +21,7 @@ input { border: 2px solid rgba(93, 99, 96, 0.705); border-radius: 5px; padding: 8px; + display: block; } @@ -62,10 +63,6 @@ body { width: 90%; } -.tool.extended .tool-context { - width: 75%; -} - .tool.extended .tool-extention { width: 20%; padding-top: 2%; diff --git a/Backend/mocked-services/src/main/resources/static/css/r11tooltip.css b/Frontend/assets/css/tools/mock/r11tooltip.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11tooltip.css rename to Frontend/assets/css/tools/mock/r11tooltip.css diff --git a/Frontend/assets/scripts/dyn_host.js b/Frontend/assets/scripts/dyn_host.js deleted file mode 100644 index efdc4c1..0000000 --- a/Frontend/assets/scripts/dyn_host.js +++ /dev/null @@ -1,6 +0,0 @@ -$(document).ready( function() { - document.getElementById("rest-mock").href = - window.location.protocol + "//" + window.location.hostname + ":8097"; - -}); - \ No newline at end of file diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js index 15cd0fa..909a4ee 100644 --- a/Frontend/assets/scripts/frame.js +++ b/Frontend/assets/scripts/frame.js @@ -1,6 +1,41 @@ +const tools = new Map(); +/** + * Get address of Mock Services + * + * @function + * @name getMockHost + * @kind function + * @returns {string} + */ +function getMockHost() { + return window.location.protocol + "//" + window.location.hostname + ":8097"; +} + +/** + * Function called after page is loaded + * + * @function + * @name init + * @kind function + * @returns {void} + */ function init() { - changeActiveTools('xmlTool', 'XML'); + + tools.set("xpath", "tools/xpath.html"); + tools.set("xsd", "tools/xsd.html"); + tools.set("xslt", "tools/xslt.html"); + tools.set("xmlform", "tools/xmlFormatter.html"); + tools.set("jsonform", "tools/jsonFormatter.html"); + tools.set("mock", "tools/mock.html"); + + changeActiveTools('XML'); + var toolUrl = window.location.search.substring(1); + if (tools.has(toolUrl)) + changeTool(toolUrl, false); + else + loadLastPage(); + } /** @@ -12,26 +47,77 @@ function init() { * @param {any} activeClass class of elements that have to be shown * @param {any} activeCategoryButton class of category button that has to be active */ -function changeActiveTools(activeClass, activeCategoryButton) { - let tools = document.getElementById("toolList").children +function changeActiveTools(activeCategoryButton) { + let toolList = document.getElementById("toolList").children; + let categoryToClass = new Map([["XML", "xmlTool"], + ["JSON", "jsonTool"], + ["REST", "restTool"]]); - for (i = 0; i < tools.length; i++) { - if (tools[i].classList.contains(activeClass)) { - tools[i].style.display = "block"; - } - else { - tools[i].style.display = "none"; - } + let activeClass = categoryToClass.get(activeCategoryButton.toUpperCase()); + if(activeClass == null) return; + + for (i = 0; i < toolList.length; i++) { + if (toolList[i].classList.contains(activeClass)) + toolList[i].style.display = "block"; + else + toolList[i].style.display = "none"; } - let categories = document.getElementById("menu").children + let categoryList = document.getElementById("menu").children; - for (i = 0; i < categories.length; i++) { - if (categories[i].innerText == activeCategoryButton) { - categories[i].classList.add("active") - } - else { - categories[i].classList.remove("active") - } + for (i = 0; i < categoryList.length; i++) { + if (categoryList[i].innerText == activeCategoryButton) + categoryList[i].classList.add("active"); + else + categoryList[i].classList.remove("active"); } +} + + +/** + * This function changes active tool. + * Optional updateURL can be set to false to stop changing URL. + * This helps avoiding endless reload loop when loading page. + * + * @function + * @name changeTool + * @kind function + * @param {any} tool + * @param {boolean} updateURL? + * @returns {void} + */ +function changeTool(tool, updateURL = true) { + if (! tools.has(tool)) return; + const url = tools.get(tool); + if (updateURL) document.location.search = tool; + + + switch (tool) { // XML category is default. + case "jsonform": + changeActiveTools('JSON'); + break; + case "mock": + changeActiveTools('REST'); + break; + } + + localStorage.setItem("lastPage", tool); + document.getElementById("iframe").src = url; + +} + +/** + * Function that loads last used tool and sets active category accordingly + * + * @function + * @name loadLastPage + * @kind function + * @returns {void} + */ +function loadLastPage() { + var lastPage = localStorage.getItem("lastPage"); + if (lastPage == null) { + lastPage = "xpath"; + } + changeTool(lastPage); } \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/json.js b/Frontend/assets/scripts/tools/json.js deleted file mode 100644 index 1f5f09c..0000000 --- a/Frontend/assets/scripts/tools/json.js +++ /dev/null @@ -1,72 +0,0 @@ -function formatAndValidateJson(errorElement) { - const input = document.querySelector('#jsonBlock'); - const processInfo = document.getElementById(errorElement); - - const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/formatting" - - fetch(address, { - method: 'POST', - body: input.textContent - }) - .then(async (response) => { - const promise = response.json(); - if (!response.ok) { - throw Error(await promise); - } - - return promise; - }) - .then((data) => { - input.innerText = data.data; - processInfo.innerText = ""; - hljs.highlightElement(input); - - processInfo.innerHTML = "Computed in " + data.time + "ms"; - }) - .catch((error) => { - processInfo.innerHTML = "" + error.data + ""; - console.error('Error:', error); - }); -} - -function minimizeJson(errorElement) { - const input = document.querySelector('#jsonBlock'); - const processInfo = document.getElementById(errorElement); - - const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/minimize" - - fetch(address, { - method: 'POST', - body: input.textContent - }) - .then(async (response) => { - const promise = response.json(); - if (!response.ok) { - throw Error(await promise); - } - - return promise; - }) - .then((data) => { - input.innerText = data.data; - processInfo.innerText = ""; - hljs.highlightElement(input); - - processInfo.innerHTML = "Computed in " + data.time + "ms"; - }) - .catch((error) => { - processInfo.innerHTML = "" + error.data + ""; - console.error('Error:', error); - }); -} - -function clearJsonData() { - const input = document.querySelector('#jsonBlock'); - input.textContent = ""; -} - -function insertDefaultJson() { - const input = document.querySelector('#jsonBlock'); - input.textContent = "{\"enter\": \"your\", \"json\": \"here\"}"; - hljs.highlightElement(input); -} \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/jsonFormatter.js b/Frontend/assets/scripts/tools/jsonFormatter.js new file mode 100644 index 0000000..64f7609 --- /dev/null +++ b/Frontend/assets/scripts/tools/jsonFormatter.js @@ -0,0 +1,250 @@ + + +const mergeHTMLPlugin = (function () { + 'use strict'; + + var originalStream; + + /** + * @param {string} value + * @returns {string} + */ + function escapeHTML(value) { + return value + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } + + + /* plugin itself */ + + /** @type {HLJSPlugin} */ + const mergeHTMLPlugin = { + // preserve the original HTML token stream + "before:highlightElement": ({ el }) => { + originalStream = nodeStream(el); + }, + // merge it afterwards with the highlighted token stream + "after:highlightElement": ({ el, result, text }) => { + if (!originalStream.length) { + return; + } + + const resultNode = document.createElement('div'); + resultNode.innerHTML = result.value; + result.value = mergeStreams(originalStream, nodeStream(resultNode), text); + el.innerHTML = result.value; + } + }; + + /** + * @param {Node} node + */ + function tag(node) { + return node.nodeName.toLowerCase(); + } + + /** + * @param {Node} node + */ + function nodeStream(node) { + /** @type Event[] */ + const result = []; + (function _nodeStream(node, offset) { + for (let child = node.firstChild; child; child = child.nextSibling) { + if (child.nodeType === 3) { + offset += child.nodeValue.length; + } else if (child.nodeType === 1) { + result.push({ + event: 'start', + offset: offset, + node: child + }); + offset = _nodeStream(child, offset); + + if (!tag(child).match(/br|hr|img|input/)) { + result.push({ + event: 'stop', + offset: offset, + node: child + }); + } + } + } + return offset; + })(node, 0); + return result; + } + + /** + * @param {any} original - the original stream + * @param {any} highlighted - stream of the highlighted source + * @param {string} value - the original source itself + */ + function mergeStreams(original, highlighted, value) { + let processed = 0; + let result = ''; + const nodeStack = []; + + function selectStream() { + if (!original.length || !highlighted.length) { + return original.length ? original : highlighted; + } + if (original[0].offset !== highlighted[0].offset) { + return (original[0].offset < highlighted[0].offset) ? original : highlighted; + } + + return highlighted[0].event === 'start' ? original : highlighted; + } + + /** + * @param {Node} node + */ + function open(node) { + /** @param {Attr} attr */ + function attributeString(attr) { + return ' ' + attr.nodeName + '="' + escapeHTML(attr.value) + '"'; + } + + // @ts-ignore + result += '<' + tag(node) + [].map.call(node.attributes, attributeString).join('') + + '>'; + } + + /** + * @param {Node} node + */ + function close(node) { + result += ''; + } + + /** + * @param {Event} event + */ + function render(event) { + (event.event === 'start' ? open : close)(event.node); + } + + while (original.length || highlighted.length) { + let stream = selectStream(); + result += escapeHTML(value.substring(processed, stream[0].offset)); + processed = stream[0].offset; + if (stream === original) { + /* + On any opening or closing tag of the original markup we first close + the entire highlighted node stack, then render the original tag along + with all the following original tags at the same offset and then + reopen all the tags on the highlighted stack. + */ + nodeStack.reverse().forEach(close); + do { + render(stream.splice(0, 1)[0]); + stream = selectStream(); + } while (stream === original && stream.length && stream[0].offset === processed); + nodeStack.reverse().forEach(open); + } else { + if (stream[0].event === 'start') { + nodeStack.push(stream[0].node); + } else { + nodeStack.pop(); + } + render(stream.splice(0, 1)[0]); + } + } + return result + escapeHTML(value.substr(processed)); + } + + return mergeHTMLPlugin; + +}()); + +function formatAndValidateJson(errorElement) { + const input = document.querySelector('#jsonBlock'); + const processInfo = document.getElementById(errorElement); + + const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/formatting" + + fetch(address, { + method: 'POST', + body: input.textContent + }) + .then(async (response) => { + const promise = response.json(); + if (!response.ok) { + throw Error(await promise); + } + + return promise; + }) + .then((data) => { + input.innerText = data.data; + processInfo.innerText = ""; + hljs.highlightElement(input); + + processInfo.innerHTML = "Computed in " + data.time + "ms"; + }) + .catch((error) => { + processInfo.innerHTML = "" + error.data + ""; + console.error('Error:', error); + }); +} + +function minimizeJson(errorElement) { + const input = document.querySelector('#jsonBlock'); + const processInfo = document.getElementById(errorElement); + + const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/minimize" + + fetch(address, { + method: 'POST', + body: input.textContent + }) + .then(async (response) => { + const promise = response.json(); + if (!response.ok) { + throw Error(await promise); + } + + return promise; + }) + .then((data) => { + input.innerText = data.data; + processInfo.innerText = ""; + hljs.highlightElement(input); + + processInfo.innerHTML = "Computed in " + data.time + "ms"; + }) + .catch((error) => { + processInfo.innerHTML = "" + error.data + ""; + console.error('Error:', error); + }); +} + +function clearJsonData() { + const input = document.querySelector('#jsonBlock'); + input.textContent = ""; +} + +function insertDefaultJson() { + const input = document.querySelector('#jsonBlock'); + input.textContent = "{\"enter\": \"your\", \"json\": \"here\"}"; + hljs.highlightElement(input); +} + +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + // Make sure that only plain text is pasted + configurePastingInElement("jsonBlock"); + + hljs.addPlugin(mergeHTMLPlugin); +} + diff --git a/Frontend/assets/scripts/tools/mock/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js new file mode 100644 index 0000000..7269faf --- /dev/null +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js @@ -0,0 +1,254 @@ +var clientUUID = ''; +var advancedDisplayed = false; +var json = {}; +var jsonIndex = 0; +var host = window.location.protocol + "//" + window.location.hostname + "/mock"; + +const C_UUID = 'mock-uuid'; +const C_ADV = 'advanced-mode'; + +const color_red = "#ff8f8f"; +const color_grey = "#6b6b6b"; + +const setModified = function(){ + setDataModified(); +} + +const getUpdate = function(){ + updateData(); +} +const dataRefresh = function(){ + getData(); +} + +/* + Listeners segment +*/ + +$(document).on('change', '.data-field', setModified); + +$('#btn-save').click( + () => { + disableSaveButton(); + } + ); + +$('#btn-newRow').click( + ()=> { + newRowInput(); + setDataModified(); + } + ); + +/* + Functions segment +*/ + +function disableSaveButton(){ + $('#btn-save').removeClass('active'); + $('#btn-save').off(); +} + +function createLink(uuid){ + var link = host + '/api/mock/r/'+uuid; + return link; +} + + +function onLoad(){ + loadCookies(); + getData(); +} + +function getData(){ + $.getJSON(host + '/api/mock/'+clientUUID, function(data) { + json = data; + loadFetchedMessage(); + initializeUUID(); + }); +} + +function loadCookies(){ + clientUUID = getCookie(C_UUID); + advancedDisplayed = getCookie(C_ADV) == 'true'; +} + +function setCookie(){ + document.cookie = C_UUID + '=' +clientUUID; + document.cookie = C_ADV + '=' + advancedVisibility; +} + +function initializeUUID(){ + if(clientUUID == null || clientUUID == undefined || clientUUID == ''){ + clientUUID = json.clientUUID; + setCookie(); + } +} + +function httpStatusInvalid(){ + value = $('#httpStatus').val(); + return value == ''; +} + +function setDataModified(){ + if(httpStatusInvalid()){ + $('#btn-save').removeClass('active'); + $('#btn-save').off(); + document.getElementById("httpStatus").style.backgroundColor = color_red; + return; + } + $('#btn-save').addClass('active'); + $('#btn-save').click(getUpdate); + document.getElementById("httpStatus").style.backgroundColor = null; +} + +function getCookie(cname) { + var name = cname + '='; + var decodedCookie = decodeURIComponent(document.cookie); + var ca = decodedCookie.split(';'); + for(var i = 0; i '+link+''; + $('#messageLink').html(linkHtml); + $('#httpStatus').val(httpStatus); + $('#typeSelector').val(contentType); + $('#bodyEditor').val(body); +} + +function fillHeaderTable(headers){ + var innerHTML = buildHeaderMapHtml(headers); + refreshHeaderTable(innerHTML); +} + +function refreshHeaderTable(html){ + $('#headerMapTable').html(html); + $('.btn-hashmap').click(function(){ + setDataModified(); + $(this).closest('tr').remove(); + }) +} + +function buildHeaderMapHtml(headers){ + var innerHTML = ''; + for(var key in headers){ + innerHTML += buildRowHtml(key, headers[key]); + } + return innerHTML; +} + +function addRow(key, value){ + var headerMap = $('#headerMapTable'); + var headersMapHtml = headerMap.html(); + headersMapHtml += buildRowHtml(key, value); + refreshHeaderTable(headersMapHtml); +} + +function newRowInput(){ + const hName = $('#headerKeyInput'); + const hValue = $('#headerValueInput'); + if(checkIfInputValid(hName.val()) && checkIfInputValid(hValue.val())){ + addRow(hName.val(), hValue.val()); + hName.val(null); + hValue.val(null); + } +} + +function checkIfInputValid(input){ + return !(input == '' || input == null || input == undefined); +} + +function checkIfHeaderEssential(key){ + + if( key == "Connection" || key == "Keep-Alive" || key == "Date" ){ + return true; + } + return false; + +} + +function buildRowHtml(key, value){ + + if(checkIfHeaderEssential(key)){ + return '' + + '' + + '' + + '' + + ''; + } + return '' + + '' + + '' + + '' + + '' + + ''; +} + +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +function createRequestBody(){ + var newJson = + { + clientUUID: json.clientUUID, + contentType: $('#typeSelector').val(), + messageBody: $('#bodyEditor').val(), + httpStatus: $('#httpStatus').val(), + httpHeaders: {}, + }; + newJson['httpHeaders'] = convertTableToJson(); + + json = newJson; + return newJson; +} + + +function convertTableToJson(){ + const rows = $('#headerMapTable').children(); + + var obj = {}; + var key; + for(let i=0; i' + + '' + parseTimeStamp(historyJson[i].dateTimeStamp) + '' + + '' + historyJson[i].httpMethod + '' + + '' + parseRequestBody(historyJson[i].requestBody, i) + '' + + ' ' + + ''; + } + return innerHTML; +} + +function parseRequestBody(requestBody,i){ + return requestBody.length == 0 ? + "No request body" : + '' +} + +function parseTimeStamp(timeStamp){ + return timeStamp.substring(0,19).replace('T',' '); +} + +function parseHeaders(pos){ + parsedJson = new Map(); + headers = historyJson[pos].headers + Object.keys( headers ).forEach( + (jsonKey) => { + parsedJson.set( jsonKey , headers[jsonKey] ); + } + ) + return parsedJson; +} + +function displayHistory(){ + $('#historyTable tbody').html(historyToHtml()); +} diff --git a/Backend/mocked-services/src/main/resources/static/js/modal.js b/Frontend/assets/scripts/tools/mock/modal.js similarity index 58% rename from Backend/mocked-services/src/main/resources/static/js/modal.js rename to Frontend/assets/scripts/tools/mock/modal.js index 3061752..c20804b 100644 --- a/Backend/mocked-services/src/main/resources/static/js/modal.js +++ b/Frontend/assets/scripts/tools/mock/modal.js @@ -7,7 +7,6 @@ var methodToCall = { const overlay = $('#overlay'); const savedModal = $('#modal-confirm'); const dataLossModal = $('#modal-query'); -const uuidChangeModal = $('#modal-uuidChanged') const dataLossModalYes = dataLossModal.children().eq(2).children().eq(0); const dataLossModalNo = dataLossModal.children().eq(2).children().eq(1); const allModals = $('.modal'); @@ -24,36 +23,10 @@ const dataLossModalDisplay = function(){ showModal(dataLossModal); } -const uuidChangeModalDisplay = function(addidionalMessage){ - - switch(addidionalMessage){ - case "success":{ - - $(".uuid-modal-body").removeClass("active"); - $("#changeUUIDSuccess").addClass("active"); - break; - } - case "new":{ - - $(".uuid-modal-body").removeClass("active"); - $("#newUUID").addClass("active"); - break; - } - case "restore":{ - - $(".uuid-modal-body").removeClass("active"); - $("#restoredUUID").addClass("active"); - break; - } - case "noChg":{ - - $(".uuid-modal-body").removeClass("active"); - $("#noChgUUID").addClass("active"); - break; - } - } - showModal(uuidChangeModal); -} +btnModalClose.click(closeModals); +overlay.click(closeModals); +dataLossModalNo.click(closeModals); +dataLossModalYes.click(dropChangesAndClose); function setMethodToCall(name, id){ methodToCall.name = name; @@ -74,16 +47,7 @@ function showModal(jmodal){ function hideModal(jmodal){ if(!modalDisplayed) return; - if ($(uuidChangeModal).hasClass('active')) window.location.reload(); overlay.removeClass('active'); jmodal.removeClass('active'); modalDisplayed = false; } - -btnModalClose.click(closeModals); - -overlay.click(closeModals); - -dataLossModalNo.click(closeModals); -dataLossModalYes.click(dropChangesAndClose); - diff --git a/Frontend/assets/scripts/tools/mock/popup.js b/Frontend/assets/scripts/tools/mock/popup.js new file mode 100644 index 0000000..0d2b91f --- /dev/null +++ b/Frontend/assets/scripts/tools/mock/popup.js @@ -0,0 +1,34 @@ + +function switchPopups (neededPopupOption) { + $('.hiddable-popup-option').addClass('hidden-popup-type'); + $('#'+neededPopupOption).removeClass('hidden-popup-type'); + } + +function showPopup(){ + $('.popup-flex').removeClass('hiddable-container'); +} + +function hidePopup(){ + $('.popup-flex').addClass('hiddable-container'); + $('.hiddable-popup-option').addClass('hidden-popup-type'); +} + +/* +* Event listener that's close the popup when user clicks out of a popup. +*/ + +window.addEventListener( + 'click' , + (clickedElement) => { + if(!document.getElementById('popup-body').contains(clickedElement.target) && clickedElement.target.className == 'popup-flex' ) { + hidePopup(); + } + } +); + +$('.popup-button-close').click( + () => { + hidePopup(); + $('.hiddable-popup-option').addClass('hidden-popup-type') + } +); \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js new file mode 100644 index 0000000..1871bdf --- /dev/null +++ b/Frontend/assets/scripts/tools/mock/uianimation.js @@ -0,0 +1,165 @@ +var advancedVisibility = false; +var focusedField = false; +/* +Listeners +*/ +$("#optional").click(changeAdvancedVisibility); + +$('#historyTab').click(showHistory); + +$('.tooltipped').on("mouseenter" , (event) => {showTip(event.currentTarget.id+'Tip')}) + .on( "mouseleave", (event) => {hideTip(event.currentTarget.id+'Tip')}); + +/* +Functions +*/ + +function changeAdvancedVisibility(){ + if(advancedVisibility){ + $("#advanced").removeClass('active'); + advancedVisibility = false; + } + else { + $('#advanced').addClass('active'); + advancedVisibility = true; + } + setCookie(); +} + +const tabitem = $('.tabitem'); +function showHistory(){ + $('#headersTab').click(showHeaders); + tabitem.removeClass('active'); + $('.tabcontent').removeClass('active'); + $('#history').addClass('active'); + $('#historyTab').addClass('active'); + $('#historyTab').off('click'); + getHistoryData(); +} + +function showHeaders(){ + $('#historyTab').click(showHistory); + tabitem.removeClass('active'); + $('.tabcontent').removeClass('active'); + $('#headers').addClass('active'); + $('#headersTab').addClass('active'); + $('#headersTab').off('click'); +} + +function showHeadersHistory(record){ + historyTable = ''; + headers = parseHeaders(record.id) + headers.forEach( + (value,key) => { + historyTable += + '' + + ''+ key + '' + + ''+ value + '' + + '' + } + ); + document.getElementById('header-history-table-body').innerHTML = historyTable; + switchPopups('history-headers-table'); + showPopup(); +} + +async function formatJSON(json) { + const backend = "java"; + const address = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/json/formatting"; + + var init = { + body: json, + method: "POST" + }; + var request = new Request(address, init); + + var result = await fetch(request).then(response => { + return response.text().then(function (text) { + var json = JSON.parse(text); + json.status = response.status; + return json; + }); + + }); + return result; +} + +async function formatXML(xml) { + const backend = "libxml"; + const address = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/prettify"; + var data = { + data: xml, + process: "", + processor: "libxml", + version: "1.0" + } + + var init = { + body: JSON.stringify(data), + method: "POST" + }; + var request = new Request(address, init); + + var result = await fetch(request).then(response => { + return response.text().then(function (text) { + return JSON.parse(text); + }); + + }); + return result; +} + +function showRequestBody(element){ + var historyRequestBody = historyJson[element.id].requestBody; + const popupContent = document.getElementById('code-highlight-content') + + document.getElementById('code-highlight-content').innerText = "Loading..."; + switch(historyJson[element.id].headers["content-type"]){ + case "application/json":{ + formatJSON(historyRequestBody).then(function(result) { + + if (result.status == "200") { + popupContent.innerText = result.data; + highlightSyntax('code-highlight-content'); + } + else { + popupContent.innerText = historyRequestBody; + } + }); + break; + } + case "application/xml": { + formatXML(historyRequestBody).then(function(result) { + if (result.status == "OK") { + popupContent.innerText = result.result; + highlightSyntax('code-highlight-content'); + } + else { + popupContent.innerText = historyRequestBody; + } + + }); + + break; + } + default:{ + popupContent.innerText = historyRequestBody; + highlightSyntax('code-highlight-content'); + } + } + switchPopups('history-request-body'); + showPopup(); +} + +function refreshHistoryRecords(){ + getHistoryData(); +} + +function hideTip(element){ + $('#'+element).removeClass('active'); +} + +function showTip(element){ + $('.tip').removeClass('active'); + $('#'+element).addClass('active'); +} diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index 9c89779..729ee8e 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -65,28 +65,6 @@ function clearDataField() { } -/** - * The `escapeHTML` function is used to escape special characters in an HTML element's innerHTML property. - * This is done to prevent these characters from being interpreted as HTML tags or attributes, - * which could potentially cause security vulnerabilities or unintended behavior. - * - * @function - * @name escapeHTML - * @kind function - * @param {any} element - * @returns {void} - */ -function escapeHTML(elementID) { - document.getElementById(elementID).innerHTML = document.getElementById(elementID).innerHTML - .replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); -} - - - /** * It fills the XML area with a sample XML. * @@ -98,7 +76,7 @@ function escapeHTML(elementID) { */ function fillDefaultXML(element) { if (element.classList.contains("active")) { - const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + const serverAddress = window.location.protocol + "//" + window.location.hostname; clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here"); fetch(serverAddress + "/assets/samples/sampleXml.xml") .then(response => response.text()) @@ -111,8 +89,18 @@ function fillDefaultXML(element) { } } + +/** +* It fills the XSD area with a sample XSD and XML area with matching XML. +* +* @function +* @name fillDefaultXSD +* @kind function +* @param {any} element +* @returns {void} +*/ function fillDefaultXSD(){ - const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + const serverAddress = window.location.protocol + "//" + window.location.hostname; fetch(serverAddress + "/assets/samples/sampleXSD.xsd") .then( response => response.text() ) .then( (XSDSchema) => { @@ -138,7 +126,7 @@ function fillDefaultXSD(){ * @returns {void} */ function fillDefaultXSLT() { - const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + const serverAddress = window.location.protocol + "//" + window.location.hostname; fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt") .then( response => response.text() ) .then( (XSTLTemplate) => { @@ -289,9 +277,9 @@ function performRequest(endpoint, checkXML, checkTransform) { var xmlData = document.getElementById(sourceId).innerText.trim(); var transformData = document.getElementById(transformId).innerText.trim(); - var port = 8081; + var backend = "java"; if (getProcessor() == "libxml") { - port = 8082; + backend = "libxml"; } var empty = false; @@ -305,7 +293,7 @@ function performRequest(endpoint, checkXML, checkTransform) { empty = true; } if (!empty) { - restRequest(port, endpoint, xmlData, transformData).then(function (result) { + restRequest(backend, endpoint, xmlData, transformData).then(function (result) { document.getElementById("resultArea").innerText = result.result; highlightSyntax("resultArea"); document.getElementById("procinfo").innerText = ' Computed using ' + result.processor; @@ -345,7 +333,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { const sourceElement = document.getElementById(sourceId); const targetElement = document.getElementById(targetId); const infoElement = document.getElementById("formatinfo"); - const port = 8082; + const backend = "libxml"; var xmlData = sourceElement.innerText.trim(); var empty = false; @@ -356,7 +344,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { } if (!empty) { - restRequest(port, endpoint, xmlData, "").then(function (result) { + restRequest(backend, endpoint, xmlData, "").then(function (result) { if (result.status == "OK") { targetElement.innerText = result.result.trim(); highlightSyntax(targetElement.id); @@ -386,16 +374,15 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { * @function * @name restRequest * @kind function -* @param {any} port of target service +* @param {any} backend target backend * @param {any} endpoint of target service * @param {any} xmlData XML that will be sent * @param {any} transformData data used to transform given XML * @returns {Promise} */ -async function restRequest(port, endpoint, xmlData, transformData) { - const escapeChar = "specialEscapeChar"; +async function restRequest(backend, endpoint, xmlData, transformData) { - const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint; + const addr = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/" + endpoint; if (defaultStrings.includes(xmlData)) { xmlData = ""; diff --git a/Frontend/assets/scripts/tools/xmlFormatter.js b/Frontend/assets/scripts/tools/xmlFormatter.js new file mode 100644 index 0000000..fef7d28 --- /dev/null +++ b/Frontend/assets/scripts/tools/xmlFormatter.js @@ -0,0 +1,34 @@ +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + configurePastingInElement("xmlArea"); +} + +/** + * Function returns processor that will be used to transform XML. + * This solution allows to use one function for sending request from every tool + * + * @function + * @name getProcessor + * @kind function + */ +function getProcessor() { + return "libxml"; +} + +/** + * Function returns version of XML processor that will be used to transform XML. + * This solution allows to use one function for sending request from every tool + * + * @function + * @name getVersion + * @kind function + */ +function getVersion() { + return "1.0" +} \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/xpath.js b/Frontend/assets/scripts/tools/xpath.js new file mode 100644 index 0000000..ab5bff6 --- /dev/null +++ b/Frontend/assets/scripts/tools/xpath.js @@ -0,0 +1,174 @@ + +/** + * The `processVersionSelector()` function is responsible for updating the display of the web page + * based on the selected processor and version. + * + * @function + * @name processVersionSelector + * @kind function + * @returns {void} + */ +function processVersionSelector() { + var processor = getProcessor(); + var hideableOptions = document.getElementsByClassName("hideable"); + for (let i = 0; i < hideableOptions.length; i++) { + hideableOptions[i].style = "display: none;"; + } + if (processor == "xalan" || processor == "libxml") { + var xalanOptions = document.getElementsByClassName("xalan"); + for (let i = 0; i < xalanOptions.length; i++) { + xalanOptions[i].style = ""; + } + document.getElementById("versions").selectedIndex = 0; + } + else { + var saxonOptions = document.getElementsByClassName("saxon"); + for (let i = 0; i < saxonOptions.length; i++) { + saxonOptions[i].style = ""; + } + document.getElementById("versions").selectedIndex = 3; + + } + processTooltip(); + +} + +/** + * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor. + * It shows or hides different sections of the tooltip based on the selected version. + * It also handles the click event on the form and updates the tooltip accordingly. + * + * @function + * @name processTooltip + * @kind function + */ +function processTooltip() { + var filter = "collapse" + getVersion(); + var collList; + + + if (filter == "collapse3.0") { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + showList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + + } else if (filter == "collapse3.1") { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + showList(document.getElementsByName("collapse31")); + } else if (filter == "collapse2.0") { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; + hideList(document.getElementsByName("collapse10")); + showList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions"; + showList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + + } +} + + + +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + + //Handle clicks in whole form and set info in tooltip + setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); + + processVersionSelector(); + processTooltip(); + tool.addEventListener('change', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID == "processors") { + processVersionSelector(); + processTooltip(); + } + else if (targetID == "versions") { + processTooltip(); + } + + + }) + tool.addEventListener('click', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "xmlArea" && targetID !== "transformArea") { + return; + } + processTooltip(); + + }) + tool.addEventListener('change', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "xmlArea" && targetID !== "transformArea") { + return; + } + processTooltip(); + }) + + var triggerList = document.getElementsByClassName("collapseTrigger"); + for (i = 0; i < triggerList.length; i++) { + + triggerList[i].addEventListener("click", function () { + var collapsible = this.parentElement; + if (this.tagName == "A") { + var collapsibleData = this.nextElementSibling; + } else { + var collapsibleData = this.parentElement.nextElementSibling; + + } + + + if (collapsibleData.style.maxHeight > "0px") { + collapsibleData.style.maxHeight = "0px"; + + this.classList.toggle("active", false); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", false); + } + + var subLists1 = collapsibleData.getElementsByClassName("content"); + var subLists2 = collapsibleData.getElementsByClassName("active"); + for (j = 0; j < subLists1.length; j++) { + subLists1[j].style.maxHeight = "0px"; + } + for (j = 0; j < subLists2.length; j++) { + subLists2[j].classList.toggle("active", false); + } + } else { + collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px"; + + this.classList.toggle("active", true); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", true); + } else { + var parentContent = this.closest(".content"); + parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px"; + } + } + }); + } +} + diff --git a/Frontend/assets/scripts/tools/xsd.js b/Frontend/assets/scripts/tools/xsd.js new file mode 100644 index 0000000..62e5612 --- /dev/null +++ b/Frontend/assets/scripts/tools/xsd.js @@ -0,0 +1,51 @@ +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + + //Handle clicks in whole form and set info in tooltip + setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + setDefaultContent(document.getElementById("transformArea"), 'Insert XSD here'); + + // refreshTooltip(); + processTooltip(); + tool.addEventListener('click', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") { + return; + } + + processTooltip(); + + }) +} + +/** + * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor. + * It shows or hides different sections of the tooltip based on the selected version. + * It also handles the click event on the form and updates the tooltip accordingly. + * + * @function + * @name processTooltip + * @kind function + */ +function processTooltip() { + + if (getProcessor() == "xalan") { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0"; + hideList(document.getElementsByName("collapse30")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0"; + showList(document.getElementsByName("collapse30")); + } +} \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/xslt.js b/Frontend/assets/scripts/tools/xslt.js new file mode 100644 index 0000000..4e61cb1 --- /dev/null +++ b/Frontend/assets/scripts/tools/xslt.js @@ -0,0 +1,100 @@ +/** + * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor. + * It shows or hides different sections of the tooltip based on the selected version. + * It also handles the click event on the form and updates the tooltip accordingly. + * + * @function + * @name processTooltip + * @kind function + */ +function processTooltip() { + + if (getProcessor() == "xalan" || getProcessor() == "libxml") { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0"; + hideList(document.getElementsByName("collapse30")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0"; + showList(document.getElementsByName("collapse30")); + } +} + + +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + + //Handle clicks in whole form and set info in tooltip + setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + setDefaultContent(document.getElementById("transformArea"), 'Insert XSLT here'); + + // refreshTooltip(); + processTooltip(); + tool.addEventListener('click', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") { + return; + } + + processTooltip(); + }) + + tool.addEventListener('change', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "processors") { + return; + } + + processTooltip(); + + }) + + var triggerList = document.getElementsByClassName("collapseTrigger"); + for (i = 0; i < triggerList.length; i++) { + + triggerList[i].addEventListener("click", function () { + + var collapsible = this.parentElement; + var collapsibleData = this.nextElementSibling; + if (collapsibleData.style.maxHeight > "0px") { + collapsibleData.style.maxHeight = "0px"; + + this.classList.toggle("active", false); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", false); + } + + var subLists1 = collapsibleData.getElementsByClassName("content"); + var subLists2 = collapsibleData.getElementsByClassName("active"); + for (j = 0; j < subLists1.length; j++) { + subLists1[j].style.maxHeight = "0px"; + } + for (j = 0; j < subLists2.length; j++) { + subLists2[j].classList.toggle("active", false); + } + } else { + collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px"; + + this.classList.toggle("active", true); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", true); + } else { + var parentContent = this.closest(".content"); + parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px"; + } + } + }); + } + +} \ No newline at end of file diff --git a/Frontend/index.html b/Frontend/index.html index abb8dbe..d8aeaa6 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -4,9 +4,7 @@ - - Release11 Web Tools @@ -22,9 +20,9 @@
@@ -34,14 +32,12 @@
- +
diff --git a/Frontend/nginx.conf b/Frontend/nginx.conf index e52fbb2..83c1bac 100644 --- a/Frontend/nginx.conf +++ b/Frontend/nginx.conf @@ -12,8 +12,31 @@ server { add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; } +<<<<<<< HEAD #error_page 404 /404.html; +======= + location /java/ { + proxy_pass http://xmltools-backend:8081/; + proxy_set_header Host $host; + } + + location /libxml/ { + proxy_pass http://xmltools-libxml-backend/; + proxy_set_header Host $host; + } + + location /mock/ { + proxy_pass http://xmltools-mocked-services:8097/; + proxy_set_header Host $host; + proxy_set_header Content-Type $http_content_type; + } + + #error_page 404 /404.html; + + + +>>>>>>> master # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; diff --git a/Frontend/tools/jsonFormatter.html b/Frontend/tools/jsonFormatter.html index 300ff95..26abb32 100644 --- a/Frontend/tools/jsonFormatter.html +++ b/Frontend/tools/jsonFormatter.html @@ -7,10 +7,16 @@ +<<<<<<< HEAD +======= + + + +>>>>>>> master @@ -32,7 +38,7 @@ + onclick="insertDefaultJson()">Insert default JSON
@@ -61,6 +67,7 @@
       
 
     
+<<<<<<< HEAD
 
     
+=======
+>>>>>>> master
   
 
diff --git a/Backend/mocked-services/src/main/resources/static/html/mock.html b/Frontend/tools/mock.html
similarity index 61%
rename from Backend/mocked-services/src/main/resources/static/html/mock.html
rename to Frontend/tools/mock.html
index d3ff264..4c00a3a 100644
--- a/Backend/mocked-services/src/main/resources/static/html/mock.html
+++ b/Frontend/tools/mock.html
@@ -3,19 +3,46 @@
 
     R11 MockedServices
     
-    
-    
-    
-    
+    
+    
+    
     
-    
 
-
+
+    
     

MockedServices

+<<<<<<< HEAD:Backend/mocked-services/src/main/resources/static/html/mock.html
@@ -42,16 +69,17 @@
+======= +>>>>>>> master:Frontend/tools/mock.html
-

Your Message

-

Messaged id: 1

+

Your Message

@@ -60,7 +88,7 @@
- + -
- +
-
+
- +
@@ -97,8 +124,8 @@
- - + +
@@ -120,8 +147,8 @@ - - + + @@ -129,40 +156,19 @@
- -
-
-
- - - -
-
- - - -
-
- -
+
- + + + -
TimestampTypeMethodRequest BodyHeaders
@@ -172,31 +178,6 @@
-
- -
-

Message List

-
- -
- -
-
- -
-
@@ -216,36 +197,8 @@

To save message, the message must be changed!

-
-
-

Add new message

-

This button adds new message.

-
-
-
-
-

UUID

-

UUID is an Unique ID that represents you in API. By UUID your messages is saved in database. You can change it to access your previous configuration of mocked messages

-
-
-
-
-

UUID Checking Strategy

-

When you provide invalid UUID you can choose what do with it. You can generate new UUID or restore previous.

-
-
-
-
-

UUID Edition

-

Unlocks you ability to edit UUID

-
-
-
-

Message

-

This is saved messages, with unique id.

-
@@ -287,22 +240,12 @@
- - - - - - + + + + + + + + + diff --git a/Frontend/tools/xmlFormatter.html b/Frontend/tools/xmlFormatter.html index c9419ea..7e3c300 100644 --- a/Frontend/tools/xmlFormatter.html +++ b/Frontend/tools/xmlFormatter.html @@ -5,8 +5,14 @@ +<<<<<<< HEAD +======= + + + +>>>>>>> master @@ -62,6 +68,7 @@
+<<<<<<< HEAD +======= +>>>>>>> master diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index b7726d4..5046126 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -5,6 +5,10 @@ +<<<<<<< HEAD +======= + +>>>>>>> master @@ -17115,6 +17119,7 @@
+<<<<<<< HEAD +======= +>>>>>>> master \ No newline at end of file diff --git a/Frontend/tools/xsd.html b/Frontend/tools/xsd.html index 100756b..73612b9 100644 --- a/Frontend/tools/xsd.html +++ b/Frontend/tools/xsd.html @@ -6,6 +6,10 @@ +<<<<<<< HEAD +======= + +>>>>>>> master @@ -79,6 +83,7 @@
+<<<<<<< HEAD +======= +>>>>>>> master \ No newline at end of file diff --git a/Frontend/tools/xslt.html b/Frontend/tools/xslt.html index 7fd299b..5867aad 100644 --- a/Frontend/tools/xslt.html +++ b/Frontend/tools/xslt.html @@ -6,6 +6,10 @@ +<<<<<<< HEAD +======= + +>>>>>>> master @@ -1147,6 +1151,7 @@ +<<<<<<< HEAD +======= +>>>>>>> master \ No newline at end of file diff --git a/Redis/Dockerfile b/Redis/Dockerfile new file mode 100644 index 0000000..644ac0f --- /dev/null +++ b/Redis/Dockerfile @@ -0,0 +1,6 @@ +FROM redis:latest + +EXPOSE 6379 + +# COPY redis.conf /usr/local/etc/redis/redis.conf +CMD [ "redis-server", "--save ''", "--appendonly no" ] \ No newline at end of file diff --git a/Samples/minimize/minimize.curl b/Samples/minimize/minimize.curl index 3a74ae5..3a94a93 100644 --- a/Samples/minimize/minimize.curl +++ b/Samples/minimize/minimize.curl @@ -1,3 +1,3 @@ -url = "http://localhost:5000/minimize" +url = "http://localhost/libxml/minimize" data = "@minimize.json" request = POST diff --git a/Samples/prettify/prettify.curl b/Samples/prettify/prettify.curl index a10aa88..fc3ab49 100644 --- a/Samples/prettify/prettify.curl +++ b/Samples/prettify/prettify.curl @@ -1,3 +1,3 @@ -url = "http://localhost:5000/prettify" +url = "http://localhost:5000/libxml/prettify" data = "@prettify.json" request = POST diff --git a/Samples/xpath/non-ns.curl b/Samples/xpath/non-ns.curl index b54c5b6..e6af844 100644 --- a/Samples/xpath/non-ns.curl +++ b/Samples/xpath/non-ns.curl @@ -1,4 +1,4 @@ -#url = "localhost:8081/xpath" -url = "localhost:5000/xpath" +url = "localhost/java/xpath" +#url = "localhost/libxml/xpath" request = "POST" data = "@data.json" diff --git a/Samples/xpath/ns.curl b/Samples/xpath/ns.curl index 46c6341..c55e0fe 100644 --- a/Samples/xpath/ns.curl +++ b/Samples/xpath/ns.curl @@ -1,4 +1,4 @@ -#url = "localhost:8081/xpath" -url = "localhost:5000/xpath" +url = "localhost/java/xpath" +#url = "localhost/libxml/xpath" request = "POST" data = "@dataNS.json" diff --git a/Samples/xsd/xsd.curl b/Samples/xsd/xsd.curl index 922856c..8de3bdd 100644 --- a/Samples/xsd/xsd.curl +++ b/Samples/xsd/xsd.curl @@ -1,4 +1,4 @@ -#url = "http://localhost:8081/xsd" -url = "http://localhost:5000/xsd" +url = "localhost/java/xsd" +#url = "localhost/libxml/xsd" data = "@xsd.json" request = POST diff --git a/Samples/xslt/xslt.curl b/Samples/xslt/xslt.curl index 712c82c..22adc0f 100644 --- a/Samples/xslt/xslt.curl +++ b/Samples/xslt/xslt.curl @@ -1,4 +1,4 @@ -#url = "http://localhost:8081/xslt" -url = "http://localhost:5000/xslt" +url = "localhost/java/xslt" +#url = "localhost/libxml/xslt" data = "@xslt.json" request = POST diff --git a/Tests/Release Tools Tests.postman_collection.json b/Tests/Release Tools Tests.postman_collection.json new file mode 100644 index 0000000..fe4e75a --- /dev/null +++ b/Tests/Release Tools Tests.postman_collection.json @@ -0,0 +1,10037 @@ +{ + "info": { + "_postman_id": "942d1101-ebd6-4bb6-9415-9feb15558985", + "name": "Release Tools Tests", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Xpath functions 2.0", + "item": [ + { + "name": "SaxonTrace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"trace(5, 'the value of 5 is:')\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAdjust-dateTime-to-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2002-05-30T03:00:00Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"2002-05-30T09:00:00+06:00\",\n \"process\": \"adjust-dateTime-to-timezone(/start)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAdjust-date-to-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2002-09-23Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"2002-09-24+06:00\",\n \"process\": \"adjust-date-to-timezone(/start)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAdjust-time-to-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"09:30:10.5Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"adjust-time-to-timezone(/start)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAnalyze-string", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\\n The\\n \\n cat\\n \\n sat\\n \\n on\\n \\n the\\n \\n mat\\n .\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"analyze-string(\\\"The cat sat on the mat.\\\", \\\"\\\\w+\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonApply", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"abc\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"apply(concat#3, [\\\"a\\\", \\\"b\\\", \\\"c\\\"])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAvailable-environment-variables", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"PATH\\nHOSTNAME\\nJAVA_HOME\\nPWD\\nJAVA_VERSION\\nLANG\\nHOME\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"available-environment-variables() \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAvg", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"avg((1,2,3))\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonBase-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.chevrolet.com/\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"base-uri(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonBoolean", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"boolean(/start) \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCodepoint-equal", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"codepoint-equal(string(/start),'09:30:10.5') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCodepoint-to-String", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"ψ\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"0968\",\n \"process\": \"codepoints-to-string(xs:integer(/start)) \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCollation-key", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AAB4AABzAAA6AABzAAB0AAByAABpAABuAABn\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"collation-key('xs:string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCollection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AAB4AABzAAA6AABzAAB0AAByAABpAABuAABn\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"collation-key('xs:string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCompare", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"compare('xs:string','jakisstring') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"contains('xs:string','string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonContains-token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"contains-token('xs:string sting strung same','string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"count(('xs:string',' sting',' strung ','same')) \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCurrent-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 10)).to.eql((new Date()).toISOString().slice(0, 10));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"current-date()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCurrent-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 18)).to.eql((new Date()).toISOString().slice(0, 18));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"current-dateTime()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCurrent-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 8)).to.eql((new Date()).toISOString().slice(11, 19));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"current-time()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonData", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"data(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDeep-equal", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"deep-equal(/l:library/l:readerList/p:person[1],/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDefault-collation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.w3.org/2005/xpath-functions/collation/codepoint\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"default-collation()\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDefault-language", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"en\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"default-language()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "Saxondistinct-values", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\\n3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"distinct-values(('1','1','2','3'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "Saxondistinct-values-parametryzacja", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\\n3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + " var request = pm.request.toJSON().url.query;", + " console.log(request);", + " pm.environment.set(\"process\", request[0].value);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"{{process}}\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "process", + "value": "distinct-values(('1','1','2','3'))", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonDocument-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"document-uri(/*)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDoc-available", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"doc-available('https://www.w3schools.com/xml/note.xml')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDoc", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\\n Tove\\n Jani\\n Reminder\\n Don't forget me this weekend!\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"doc('https://www.w3schools.com/xml/note.xml')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEmpty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + " pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"empty(/l:library/l:readerList/p:person[0])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEncode-for-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"l%3Alibrary%2Fl%3AreaderList\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"encode-for-uri('l:library/l:readerList')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEnds-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ends-with('l:library/l:readerList','ist')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEnvironment-variable", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"/usr/local/openjdk-18\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"environment-variable('JAVA_HOME')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonError", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Error signalled by application call on error()\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"error()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonExactly-one", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" \");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"exactly-one(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonExists", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"exists(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFalse", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"false()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(5.5)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFold-left", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"15\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"fold-left(1 to 5, 0, function($a, $b) { $a + $b })\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFold-right", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"15\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"fold-right(1 to 5, 0, function($a, $b) { $a + $b })\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFor-each", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n4\\n9\\n16\\n25\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"for-each(1 to 5, function($a) { $a * $a })\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFor-each-pair", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"ax\\nby\\ncz\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"for-each-pair(('a', 'b', 'c'), ('x', 'y', 'z'), concat#2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " const date = new Date();", + "", + "let day = date.getDate();", + "let month = date.getMonth() + 1;", + "let year = date.getFullYear();", + "if (date < 10) {", + " date = '0' + date;", + "}", + "", + "if (month < 10) {", + " month = '0' + month;", + "}", + "", + "// This arrangement can be altered based on how we want the date's format to appear.", + "let currentDate = `${month}/${day}/${year}`;", + "console.log(currentDate); // \"17-6-2022\"", + " pm.expect(jsonData.result).to.eql(currentDate);", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-date(current-date(), '[M01]/[D01]/[Y0001]')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " const date = new Date();", + "", + "let day = date.getDate();", + "let month = date.getMonth() + 1;", + "let year = date.getFullYear();", + "if (date < 10) {", + " date = '0' + date;", + "}", + "", + "if (month < 10) {", + " month = '0' + month;", + "}", + "", + "// This arrangement can be altered based on how we want the date's format to appear.", + "let currentDate = `${month}/${day}/${year}`;", + "console.log(currentDate); // \"17-6-2022\"", + " pm.expect(jsonData.result).to.eql(currentDate);", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-dateTime(current-dateTime(), '[M01]/[D01]/[Y0001]')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-integer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"one hundred and twenty three\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-integer(123, 'w')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-number", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"14%\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-number(0.14, '01%')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date()).toISOString().slice(11, 19));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-time(current-time(), '[H01]:[m01]:[s01]')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFunction-arity", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"function-arity(substring#3)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFunction-lookup", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2011-11-11T11:11:11Z');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \" (function-lookup(xs:QName('xs:dateTimeStamp'), 1), xs:dateTime#1)[1] ('2011-11-11T11:11:11Z')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFunction-name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('fn:substring');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"function-name(substring#3)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonGenerate-id", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('d0e11');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"generate-id(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHas-children", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"has-children(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHead", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(' ');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"head(/l:library/l:readerList/p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHours-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date().getHours()-2).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"hours-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHours-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('10');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"hours-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHours-from-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('11');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"hours-from-time(xs:time('11:23:00'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"id(d0e1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "Saxonidref", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"idref(d0e11)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonImplicit-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"implicit-timezone()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonIndex-of", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2\\n5');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"index-of((10, 20, 30, 30, 20, 10), 20)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonInnermost", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(' \\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 5123\\n Lauren\\n Wong\\n\\n\\n 6422\\n Harry Potter\\n 7542\\n\\n\\n 1234\\n Macbeth\\n 5123\\n\\n\\n 9556\\n Romeo and Juliet\\n');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"innermost((/l:library/l:bookList/b:book , /l:library/l:readerList/p:person))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonIn-scope-prefixes", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('b\\nl\\np\\nxsi\\nxml');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"in-scope-prefixes(/l:library/l:bookList/b:book[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonInsert-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1\\n2\\n8\\n9\\n10\\n3\\n4\\n5\\n6\\n7');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"insert-before((1,2,3,4,5,6,7),3,(8,9,10))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonIri-to-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('http://tools.zipper.release11.com:8086/');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"iri-to-uri ('http://tools.zipper.release11.com:8086/')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonJson-to-xml", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('\\n saxon\\n');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"{\\\"processor\\\": \\\"saxon\\\"}\",\n \"process\": \"json-to-xml(/)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLang", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('false');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"lang(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('4\\n4\\n4\\n4');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person/last()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLoad-xquery-module", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('An empty sequence is not allowed as the first argument of fn:load-xquery-module()');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"load-xquery-module(document-uri(/))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLocal-name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('library');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLocal-name-from-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('person');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name-from-QName(QName(\\\"http://www.example.com/example\\\", \\\"person\\\"))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLower-case", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('sarcastic');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"lower-case('SaRcAsTiC')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMatches", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"matches(/l:library/l:readerList/p:person[2]/p:name,'Adam')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMax", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('6');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"max((2,3,4,5,6,1))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"min((2,3,4,5,6,1))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMinutes-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date().getMinutes()).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"minutes-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMinutes-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"minutes-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMinutes-from-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('23');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"minutes-from-time(xs:time('11:23:00'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMonth-from-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"month-from-date(xs:date('2023-03-16'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMonth-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date().getMonth()+1).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"month-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMonths-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"months-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('l:library');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/name()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/library\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/namespace-uri()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri-for-prefix", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.w3.org/XML/1998/namespace\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri-for-prefix('xml', element())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri-from-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.example.com/example\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri-from-QName(QName('http://www.example.com/example', 'person'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNilled", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"nilled(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNode-name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"l:library\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"node-name(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"aaaa aaa a aaa\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space(' aaaa aaa a aaa ')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNormalize-unicode", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"aaaa aaa a aaa\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-unicode(' aaaa aaa a aaa ','NFKC')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNot", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"not(1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1.11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(1.11)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonOne-or-more", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" \\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 5123\\n Lauren\\n Wong\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"one-or-more(/l:library/l:readerList/p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonOutermost", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" \\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 5123\\n Lauren\\n Wong\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"outermost(/l:library/l:readerList/p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-ietf-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1994-06-06T07:29:35Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-ietf-date('Wed, 06 Jun 1994 07:29:35 GMT')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-json", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"map{\\\"data\\\":\\\"09:30:10.5\\\"}\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-json('{\\\"data\\\": \\\"09:30:10.5\\\"}')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-xml", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"09:30:10.5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-xml('09:30:10.5')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-xml-fragment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"09:30:10.5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-xml-fragment('09:30:10.5')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPath", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"/Q{http://www.release11.com/library}library[1]/Q{http://www.release11.com/library}readerList[1]/Q{http://www.release11.com/person}person[2]\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"path(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\\n3\\n4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person/position()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPrefix-from-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"prefix-from-QName(QName('http://www.example.com/example', 'p:person'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonQName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"QName('http://www.example.com/example', 'p:person')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRandom-number-generator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 24)).to.eql(\"map{\\\"next\\\":Q{anon}anon#0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"random-number-generator()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRemove", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n3\\n4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"remove(('1','2','3','4'),2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonReplace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"ACC\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"replace('ABC', 'B', 'C')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonResolve-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"hell\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"resolve-QName('hell', /l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonResolve-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"resolve-uri('p:person')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonReverse", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\\n3\\n2\\n1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"reverse(('1','2','3','4'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRoot", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\\n City library\\n 345123\\n \\n \\n \\n 7321\\n Adam\\n Choke\\n \\n \\n 7321\\n Adam\\n Choke\\n \\n \\n 5123\\n Lauren\\n Wong\\n \\n \\n \\n \\n 6422\\n Harry Potter\\n 7542\\n \\n \\n 1234\\n Macbeth\\n 5123\\n \\n \\n 9556\\n Romeo and Juliet\\n \\n \\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"root(//p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(5.49)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRound-half-to-even", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5.5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round-half-to-even(5.49,1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSeconds-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 2)).to.eql((new Date().getSeconds()).toString() || (new Date().getSeconds()-1).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"seconds-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSeconds-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"seconds-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSeconds-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"seconds-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSerialize", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1 2 3 4');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"serialize((1,2,3,4))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSort", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1\\n-2\\n5\\n8\\n10\\n-10\\n10');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sort((1, -2, 5, 10, -10, 10, 8), (), abs#1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with('ABC','A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonStatic-base-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/static-base-uri()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('Adam');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string(/l:library/l:readerList/p:person[2]/p:name)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-join", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1A2A3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-join((1,2,3),'A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length('A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-to-codepoints", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('65');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-to-codepoints('A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubsequence", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2\\n3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"subsequence((1,2,3,4),2,2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('BC');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring('ABCDEF',2,2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('BCDEF');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after ('ACBCDEF','C')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('A');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before ('ACBCDEF','C')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('6');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum((1,2,3))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTail", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2\\n3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"tail((1,2,3))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTimezone-from-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"timezone-from-date(current-date())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTimezone-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"timezone-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTimezone-from-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"timezone-from-time(current-time())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTokenize", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('B\\nCB\\nB\\nD');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"tokenize('BACBABAD','A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTrace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('Adam\\nAdam\\nLauren');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"trace(//p:name[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('BAr');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate('bar','abc','ABC')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTrue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"true()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnordered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('4\\n3\\n2\\n4\\n5');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unordered((4, 3, 2, 4, 5))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnparsed-text", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('.dockerenv\\napp\\nbin\\nboot\\ndev\\netc\\nhome\\nlib\\nlib64\\nmedia\\nmnt\\nopt\\nproc\\nroot\\nrun\\nsbin\\nsrv\\nsys\\ntmp\\nusr\\nvar');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unparsed-text('')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnparsed-text-available", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unparsed-text-available('')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnparsed-text-lines", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('.dockerenv\\napp\\nbin\\nboot\\ndev\\netc\\nhome\\nlib\\nlib64\\nmedia\\nmnt\\nopt\\nproc\\nroot\\nrun\\nsbin\\nsrv\\nsys\\ntmp\\nusr\\nvar');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unparsed-text-lines ('')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUpper-case", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('AAA');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"upper-case('aaa')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUri-collection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('Invalid URI passed to uri-collection: City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet ');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"uri-collection(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonXml-to-json", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('[1,\\\"is\\\",true]');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"xml-to-json(/)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonYear-from-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(new Date().getFullYear().toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"year-from-date(current-date())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonYear-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(new Date().getFullYear().toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"year-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonYears-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"years-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonZero-or-one", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"zero-or-one((1))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Xpath functions 1.0", + "item": [ + { + "name": "LIBXMLString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string(11)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLConcat", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AdamChoke\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"concat(/l:library/l:readerList/p:person[1]/p:name,/l:library/l:readerList/p:person[1]/p:surname)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LlibXMLBasic", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Test1\\n\\nTest3\\n\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"/values/value\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Lauren \\n\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[last()]/p:name\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" 5123 Lauren Wong \\n\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[position()=2]\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"count(/l:library/l:readerList/p:person)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLLocalName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIMXMLContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"True\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"contains(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"True\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIMXMLSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1999\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"04/01\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"234\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring(\\\"12345\\\", 1.5, 2.6)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length(\\\"Adam\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"A d am\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space (\\\" A d am \\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"BAr\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate(\\\"bar\\\",\\\"abc\\\",\\\"ABC\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanBasic", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Test1\\nTest3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"/values/value\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string('11')\",\n \"processor\": \"xalan\",\n \"version\": \"1.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Lauren\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[last()]/p:name\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" 5123 Lauren Wong \");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[position()=2]\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"count(/l:library/l:readerList/p:person)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanLocalName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "XalanConcat", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AdamChoke\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"concat(/l:library/l:readerList/p:person[1]/p:name,/l:library/l:readerList/p:person[1]/p:surname)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"contains(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1999\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"04/01\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"234\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring(\\\"12345\\\", 1.5, 2.6)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length(\\\"Adam\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"A d am\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space (\\\" A d am \\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"BAr\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate(\\\"bar\\\",\\\"abc\\\",\\\"ABC\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonBasic", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Test1\\nTest3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"/values/value\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string(11)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Lauren\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[last()]/p:name\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person/position()\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/count(p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLocalName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/namespace-uri(p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ] + } + }, + "response": [] + }, + { + "name": "SaxonName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/name(p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonConcat", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AdamChoke\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"concat(/l:library/l:readerList/p:person[1]/p:name,/l:library/l:readerList/p:person[1]/p:surname)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"contains(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1999\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"04/01\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"234\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring(\\\"12345\\\", 1.5, 2.6)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length(\\\"Adam\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"A d am\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space (\\\" A d am \\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"BAr\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate(\\\"bar\\\",\\\"abc\\\",\\\"ABC\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(11)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"12444.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum(/l:library/l:readerList/p:person/p:readerID)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLCeiling", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ceiling(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"3.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(3.14)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL2}}", + "host": [ + "{{TestURL2}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(11)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"12444\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum(/l:library/l:readerList/p:person/p:readerID)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanCeiling", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ceiling(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(3.14)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(11)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"12444\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum(/l:library/l:readerList/p:person/p:readerID)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(1.1)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonCeiling", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ceiling(1.1)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(3.14)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{TestURL1}}", + "host": [ + "{{TestURL1}}" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "JSON", + "item": [ + { + "name": "Format Array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = '[\\n {\\n \\\"name\\\": \\\"John\\\",\\n \\\"age\\\": 30.0,\\n \\\"city\\\": \\\"New York\\\"\\n }\\n]';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "[{\"name\": \"John\",\"age\": 30,\"city\": \"New York\"}]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonFormattingURL}}", + "host": [ + "{{JsonFormattingURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Format Broken Array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = 'End of input at line 1 column 47 path $[1]';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "[{\"name\": \"John\",\"age\": 30,\"city\": \"New York\"}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonFormattingURL}}", + "host": [ + "{{JsonFormattingURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Format Object", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = '{\\n \\\"name\\\": \\\"John\\\",\\n \\\"age\\\": 30.0,\\n \\\"city\\\": \\\"New York\\\"\\n}';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\"name\": \"John\",\"age\": 30,\"city\": \"New York\"}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonFormattingURL}}", + "host": [ + "{{JsonFormattingURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Format Broken Object", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = 'End of input at line 1 column 45 path $.city';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\"name\": \"John\",\"age\": 30,\"city\": \"New York\"", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonFormattingURL}}", + "host": [ + "{{JsonFormattingURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Minimize Object", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = '{\\\"name\\\":\\\"John\\\",\\\"age\\\":30.0,\\\"city\\\":\\\"New York\\\"}';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"John\",\n \"age\": 30,\n \"city\": \"New York\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonMinimizeURL}}", + "host": [ + "{{JsonMinimizeURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Minimize Broken Object", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = 'End of input at line 4 column 23 path $.city';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"John\",\n \"age\": 30,\n \"city\": \"New York\"", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonMinimizeURL}}", + "host": [ + "{{JsonMinimizeURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Minimize Array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = '[{\\\"name\\\":\\\"John\\\",\\\"age\\\":30.0,\\\"city\\\":\\\"New York\\\"}]';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "[\n {\n \"name\": \"John\",\n \"age\": 30,\n \"city\": \"New York\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonMinimizeURL}}", + "host": [ + "{{JsonMinimizeURL}}" + ] + } + }, + "response": [] + }, + { + "name": "Minimize Broken Array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Returns correct result\", function () {", + " var jsonData = pm.response.json();", + " var expected = 'End of input at line 6 column 6 path $[1]';", + " pm.expect(jsonData.data).to.eql(expected);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "[\n {\n \"name\": \"John\",\n \"age\": 30,\n \"city\": \"New York\"\n }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{JsonMinimizeURL}}", + "host": [ + "{{JsonMinimizeURL}}" + ] + } + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "TestURL1", + "value": "http://tools.zipper.release11.com:8081/xpath", + "type": "default" + }, + { + "key": "TestURL2", + "value": "http://tools.zipper.release11.com:8082/xpath", + "type": "default" + }, + { + "key": "JsonFormattingURL", + "value": "http://tools-test.zipper.release11.com/java/json/formatting", + "type": "default" + }, + { + "key": "JsonMinimizeURL", + "value": "http://tools-test.zipper.release11.com/java/json/minimize", + "type": "default" + } + ] +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 6a620bb..4345161 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,8 @@ version: "3" services: redis: - image: 'redis' + container_name: xmltools-redis + build: ./Redis restart: "no" xmltools-frontend: @@ -10,21 +11,21 @@ services: container_name: xmltools-frontend image: xmltools-frontend ports: - - 8086:80 + - 80:80 xmltools-backend: build: ./Backend/tools-services container_name: xmltools-backend image: xmltools-backend ports: - - 8081:8081 + - 8081:8081 xmltools-libxml-backend: build: ./Backend-libXML container_name: xmltools-libxml-backend image: xmltools-libxml-backend ports: - - 8082:80 + - 8082:80 xmltools-mocked-services: build: @@ -38,6 +39,7 @@ services: - redis environment: SPRING_PROFILES_ACTIVE: DEV + TZ: Europe/Warsaw swagger: image: "swaggerapi/swagger-ui:latest"