Fix ContentTypeTestCase failure
@@ -22,25 +22,19 @@ import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
-import org.apache.axiom.om.OMElement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
-import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import org.wso2.carbon.integration.common.utils.ClientConnectionUtil;
import org.wso2.esb.integration.common.utils.ESBIntegrationTest;
-import org.wso2.esb.integration.common.utils.ESBTestCaseUtils;
import java.io.IOException;
import java.io.OutputStream;
-import java.net.InetAddress;
import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
import static org.testng.Assert.assertEquals;
@@ -55,11 +49,6 @@ public class ContentTypeTestCase extends ESBIntegrationTest {
public void init() throws Exception {
super.init();
- String relativePath = "/artifacts/ESB/synapseconfig/esbjava2283/api.xml";
- ESBTestCaseUtils util = new ESBTestCaseUtils();
- relativePath = relativePath.replaceAll("[\\\\/]", "/");
- OMElement apiConfig = util.loadResource(relativePath);
- addApi(apiConfig);
}
@Test(groups = { "wso2.esb" }, description = "Test different content types", dataProvider = "contentTypeProvider")
@@ -103,29 +92,10 @@ public class ContentTypeTestCase extends ESBIntegrationTest {
}
}
- @AfterClass(alwaysRun = true)
- public void destroy() throws Exception {
-
- super.cleanup();
- }
-
@DataProvider(name = "contentTypeProvider")
public Object[][] getContentTypes() {
return new Object[][] { { "application/xml" }, { "text/plain" }, { "application/json" }, { "text/xml" },
{ "application/x-www-form-urlencoded" }, { "multipart/form-data" }, { "text/xml" }, };
}
-
- public boolean waitForPortCloser(int port) throws UnknownHostException {
-
- long time = System.currentTimeMillis() + 5000;
- boolean isPortAvailable = true;
- while (System.currentTimeMillis() < time) {
- isPortAvailable = ClientConnectionUtil.isPortOpen(port, InetAddress.getLocalHost().getHostName());
- if (!isPortAvailable) {
- return isPortAvailable;
- }
- }
- return isPortAvailable;
- }
}
