| 103 | }; |
| 104 | |
| 105 | void run_variance(std::string test_file_location, bool isSecure, std::string url, const struct test_profile &profile) { |
| 106 | SiteToSiteTestHarness harness(isSecure); |
| 107 | |
| 108 | std::string in_port = "471deef6-2a6e-4a7d-912a-81cc17e3a204"; |
| 109 | std::string out_port = "471deef6-2a6e-4a7d-912a-81cc17e3a203"; |
| 110 | |
| 111 | SiteToSiteLocationResponder *responder = new SiteToSiteLocationResponder(isSecure); |
| 112 | |
| 113 | TransactionResponder *transaction_response = new TransactionResponder(url, in_port, |
| 114 | true, profile.transaction_url_broken, profile.empty_transaction_url); |
| 115 | |
| 116 | std::string transaction_id = transaction_response->getTransactionId(); |
| 117 | |
| 118 | harness.setKeyDir(""); |
| 119 | |
| 120 | std::string controller_loc = url + "/controller"; |
| 121 | |
| 122 | std::string basesitetosite = url + "/site-to-site"; |
| 123 | SiteToSiteBaseResponder *base = new SiteToSiteBaseResponder(basesitetosite); |
| 124 | |
| 125 | harness.setUrl(basesitetosite,base); |
| 126 | |
| 127 | harness.setUrl(controller_loc, responder); |
| 128 | |
| 129 | std::string transaction_url = url + "/data-transfer/input-ports/" + in_port + "/transactions"; |
| 130 | std::string action_url = url + "/site-to-site/input-ports/" + in_port + "/transactions"; |
| 131 | |
| 132 | std::string transaction_output_url = url + "/data-transfer/output-ports/" + out_port + "/transactions"; |
| 133 | std::string action_output_url = url + "/site-to-site/output-ports/" + out_port + "/transactions"; |
| 134 | |
| 135 | harness.setUrl(transaction_url, transaction_response); |
| 136 | |
| 137 | std::string peer_url = url + "/site-to-site/peers"; |
| 138 | |
| 139 | PeerResponder *peer_response = new PeerResponder(url); |
| 140 | |
| 141 | harness.setUrl(peer_url, peer_response); |
| 142 | |
| 143 | std::string flow_url = action_url + "/" + transaction_id + "/flow-files"; |
| 144 | |
| 145 | FlowFileResponder *flowResponder = new FlowFileResponder(true, profile.flow_url_broken, profile.invalid_checksum); |
| 146 | flowResponder->setFlowUrl(flow_url); |
| 147 | auto producedFlows = flowResponder->getFlows(); |
| 148 | |
| 149 | TransactionResponder *transaction_response_output = new TransactionResponder(url, out_port, |
| 150 | false, profile.transaction_url_broken, profile.empty_transaction_url); |
| 151 | std::string transaction_output_id = transaction_response_output->getTransactionId(); |
| 152 | transaction_response_output->setFeed(producedFlows); |
| 153 | |
| 154 | harness.setUrl(transaction_output_url, transaction_response_output); |
| 155 | |
| 156 | std::string flow_output_url = action_output_url + "/" + transaction_output_id + "/flow-files"; |
| 157 | |
| 158 | FlowFileResponder* flowOutputResponder = new FlowFileResponder(false, profile.flow_url_broken, profile.invalid_checksum); |
| 159 | flowOutputResponder->setFlowUrl(flow_output_url); |
| 160 | flowOutputResponder->setFeed(producedFlows); |
| 161 | |
| 162 | harness.setUrl(flow_url, flowResponder); |