Commit eec811ea by Shwetha GS

ATLAS-297 KafkaNotificationTest.testSendReceiveMessage fails when atlas-server…

ATLAS-297 KafkaNotificationTest.testSendReceiveMessage fails when atlas-server is running on the same machine (yhemanth via shwethags)
parent 9370d4a8
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
<skip>${skipTests}</skip> <skip>${skipTests}</skip>
<!--only skip int tests --> <!--only skip int tests -->
<httpConnector> <httpConnector>
<port>21000</port> <port>31000</port>
<idleTimeout>60000</idleTimeout> <idleTimeout>60000</idleTimeout>
</httpConnector> </httpConnector>
<war>../../webapp/target/atlas-webapp-${project.version}.war</war> <war>../../webapp/target/atlas-webapp-${project.version}.war</war>
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
</systemProperty> </systemProperty>
</systemProperties> </systemProperties>
<stopKey>atlas-stop</stopKey> <stopKey>atlas-stop</stopKey>
<stopPort>21001</stopPort> <stopPort>31001</stopPort>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
......
...@@ -18,12 +18,14 @@ ...@@ -18,12 +18,14 @@
package org.apache.atlas.hive.hook; package org.apache.atlas.hive.hook;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClient; import org.apache.atlas.AtlasClient;
import org.apache.atlas.ParamChecker; import org.apache.atlas.ParamChecker;
import org.apache.atlas.hive.bridge.HiveMetaStoreBridge; import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
import org.apache.atlas.hive.model.HiveDataModelGenerator; import org.apache.atlas.hive.model.HiveDataModelGenerator;
import org.apache.atlas.hive.model.HiveDataTypes; import org.apache.atlas.hive.model.HiveDataTypes;
import org.apache.atlas.typesystem.Referenceable; import org.apache.atlas.typesystem.Referenceable;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -60,7 +62,8 @@ public class HiveHookIT { ...@@ -60,7 +62,8 @@ public class HiveHookIT {
ss = SessionState.start(ss); ss = SessionState.start(ss);
SessionState.setCurrentSessionState(ss); SessionState.setCurrentSessionState(ss);
dgiCLient = new AtlasClient(DGI_URL); Configuration configuration = ApplicationProperties.get();
dgiCLient = new AtlasClient(configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT, DGI_URL));
} }
private void runCommand(String cmd) throws Exception { private void runCommand(String cmd) throws Exception {
......
...@@ -35,3 +35,8 @@ atlas.http.authentication.enabled=false ...@@ -35,3 +35,8 @@ atlas.http.authentication.enabled=false
atlas.http.authentication.type=simple atlas.http.authentication.type=simple
######### Security Properties ######### ######### Security Properties #########
######### Server Properties #########
# Configuring a 'test' port different from where a local atlas server instance would run
atlas.rest.address=http://localhost:31000
######### Server Properties #########
...@@ -9,6 +9,7 @@ ATLAS-54 Rename configs in hive hook (shwethags) ...@@ -9,6 +9,7 @@ ATLAS-54 Rename configs in hive hook (shwethags)
ATLAS-3 Mixed Index creation fails with Date types (sumasai via shwethags) ATLAS-3 Mixed Index creation fails with Date types (sumasai via shwethags)
ALL CHANGES: ALL CHANGES:
ATLAS-297 KafkaNotificationTest.testSendReceiveMessage fails when atlas-server is running on the same machine (yhemanth via shwethags)
ATLAS-306 change javadoc generation from 'package' to 'site' phase(jspeidel via sumasai) ATLAS-306 change javadoc generation from 'package' to 'site' phase(jspeidel via sumasai)
ATLAS-289 updateEntity does not remove existing edge for multiplicity-one reference (dkantor via shwethags) ATLAS-289 updateEntity does not remove existing edge for multiplicity-one reference (dkantor via shwethags)
ATLAS-300 Need additional integration test coverage for entity notifications (tbeerbower via shwethags) ATLAS-300 Need additional integration test coverage for entity notifications (tbeerbower via shwethags)
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
# limitations under the License. # limitations under the License.
# #
######### Atlas Server Configs #########
atlas.rest.address=http://localhost:31000
######### Graph Database Configs ######### ######### Graph Database Configs #########
# Graph Storage # Graph Storage
atlas.graph.storage.backend=${titan.storage.backend} atlas.graph.storage.backend=${titan.storage.backend}
...@@ -58,8 +61,8 @@ atlas.lineage.hive.table.schema.query.hive_table=hive_table where name='%s'\, co ...@@ -58,8 +61,8 @@ atlas.lineage.hive.table.schema.query.hive_table=hive_table where name='%s'\, co
######### Notification Configs ######### ######### Notification Configs #########
atlas.notification.embedded=true atlas.notification.embedded=true
atlas.kafka.zookeeper.connect=localhost:9026 atlas.kafka.zookeeper.connect=localhost:19026
atlas.kafka.bootstrap.servers=localhost:9027 atlas.kafka.bootstrap.servers=localhost:19027
atlas.kafka.data=target/data/kafka atlas.kafka.data=target/data/kafka
atlas.kafka.zookeeper.session.timeout.ms=400 atlas.kafka.zookeeper.session.timeout.ms=400
atlas.kafka.zookeeper.sync.time.ms=20 atlas.kafka.zookeeper.sync.time.ms=20
...@@ -71,5 +74,6 @@ atlas.kafka.entities.group.id=atlas_entities ...@@ -71,5 +74,6 @@ atlas.kafka.entities.group.id=atlas_entities
# SSL config # SSL config
atlas.enableTLS=false atlas.enableTLS=false
atlas.server.https.port=31443
######### Security Properties ######### ######### Security Properties #########
...@@ -337,7 +337,7 @@ ...@@ -337,7 +337,7 @@
<skip>${skipTests}</skip> <skip>${skipTests}</skip>
<!--only skip int tests --> <!--only skip int tests -->
<httpConnector> <httpConnector>
<port>21000</port> <port>31000</port>
<idleTimeout>60000</idleTimeout> <idleTimeout>60000</idleTimeout>
</httpConnector> </httpConnector>
<war>${project.build.directory}/atlas-webapp-${project.version}.war</war> <war>${project.build.directory}/atlas-webapp-${project.version}.war</war>
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
</systemProperty> </systemProperty>
</systemProperties> </systemProperties>
<stopKey>atlas-stop</stopKey> <stopKey>atlas-stop</stopKey>
<stopPort>21001</stopPort> <stopPort>31001</stopPort>
<daemon>${debug.jetty.daemon}</daemon> <daemon>${debug.jetty.daemon}</daemon>
<testClassesDirectory>${project.build.directory}/../../webapp/target/test-classes/</testClassesDirectory> <testClassesDirectory>${project.build.directory}/../../webapp/target/test-classes/</testClassesDirectory>
<useTestClasspath>true</useTestClasspath> <useTestClasspath>true</useTestClasspath>
......
...@@ -24,8 +24,7 @@ import com.sun.jersey.api.client.Client; ...@@ -24,8 +24,7 @@ import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig;
import org.apache.atlas.AtlasClient; import org.apache.atlas.*;
import org.apache.atlas.ParamChecker;
import org.apache.atlas.typesystem.Referenceable; import org.apache.atlas.typesystem.Referenceable;
import org.apache.atlas.typesystem.Struct; import org.apache.atlas.typesystem.Struct;
import org.apache.atlas.typesystem.TypesDef; import org.apache.atlas.typesystem.TypesDef;
...@@ -45,6 +44,7 @@ import org.apache.atlas.typesystem.types.TraitType; ...@@ -45,6 +44,7 @@ import org.apache.atlas.typesystem.types.TraitType;
import org.apache.atlas.typesystem.types.TypeUtils; import org.apache.atlas.typesystem.types.TypeUtils;
import org.apache.atlas.typesystem.types.utils.TypesUtil; import org.apache.atlas.typesystem.types.utils.TypesUtil;
import org.apache.atlas.web.util.Servlets; import org.apache.atlas.web.util.Servlets;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.RandomStringUtils;
import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
...@@ -64,9 +64,9 @@ import java.util.List; ...@@ -64,9 +64,9 @@ import java.util.List;
*/ */
public abstract class BaseResourceIT { public abstract class BaseResourceIT {
public static final String ATLAS_REST_ADDRESS = "atlas.rest.address";
protected WebResource service; protected WebResource service;
protected AtlasClient serviceClient; protected AtlasClient serviceClient;
public static String baseUrl = "http://localhost:21000/";
public static final Logger LOG = LoggerFactory.getLogger(BaseResourceIT.class); public static final Logger LOG = LoggerFactory.getLogger(BaseResourceIT.class);
@BeforeClass @BeforeClass
...@@ -74,6 +74,8 @@ public abstract class BaseResourceIT { ...@@ -74,6 +74,8 @@ public abstract class BaseResourceIT {
DefaultClientConfig config = new DefaultClientConfig(); DefaultClientConfig config = new DefaultClientConfig();
Client client = Client.create(config); Client client = Client.create(config);
Configuration configuration = ApplicationProperties.get();
String baseUrl = configuration.getString(ATLAS_REST_ADDRESS, "http://localhost:21000/");
client.resource(UriBuilder.fromUri(baseUrl).build()); client.resource(UriBuilder.fromUri(baseUrl).build());
service = client.resource(UriBuilder.fromUri(baseUrl).build()); service = client.resource(UriBuilder.fromUri(baseUrl).build());
......
...@@ -19,9 +19,11 @@ package org.apache.atlas.web.service; ...@@ -19,9 +19,11 @@ package org.apache.atlas.web.service;
import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.Atlas;
import org.apache.atlas.AtlasException;
import org.apache.atlas.web.TestUtils; import org.apache.atlas.web.TestUtils;
import org.apache.atlas.web.resources.AdminJerseyResourceIT; import org.apache.atlas.web.resources.AdminJerseyResourceIT;
import org.apache.atlas.web.resources.BaseResourceIT;
import org.apache.atlas.web.resources.EntityJerseyResourceIT; import org.apache.atlas.web.resources.EntityJerseyResourceIT;
import org.apache.atlas.web.resources.MetadataDiscoveryJerseyResourceIT; import org.apache.atlas.web.resources.MetadataDiscoveryJerseyResourceIT;
import org.apache.atlas.web.resources.RexsterGraphJerseyResourceIT; import org.apache.atlas.web.resources.RexsterGraphJerseyResourceIT;
...@@ -35,7 +37,6 @@ import org.apache.hadoop.security.alias.JavaKeyStoreProvider; ...@@ -35,7 +37,6 @@ import org.apache.hadoop.security.alias.JavaKeyStoreProvider;
import org.testng.Assert; import org.testng.Assert;
import org.testng.TestListenerAdapter; import org.testng.TestListenerAdapter;
import org.testng.TestNG; import org.testng.TestNG;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
...@@ -57,10 +58,12 @@ import static org.apache.atlas.security.SecurityProperties.TRUSTSTORE_PASSWORD_K ...@@ -57,10 +58,12 @@ import static org.apache.atlas.security.SecurityProperties.TRUSTSTORE_PASSWORD_K
public class SecureEmbeddedServerTestBase { public class SecureEmbeddedServerTestBase {
public static final int ATLAS_DEFAULT_HTTPS_PORT = 21443;
private SecureEmbeddedServer secureEmbeddedServer; private SecureEmbeddedServer secureEmbeddedServer;
protected String providerUrl; protected String providerUrl;
private Path jksPath; private Path jksPath;
protected WebResource service; protected WebResource service;
private int securePort;
static { static {
//for localhost testing only //for localhost testing only
...@@ -79,13 +82,9 @@ public class SecureEmbeddedServerTestBase { ...@@ -79,13 +82,9 @@ public class SecureEmbeddedServerTestBase {
} }
@BeforeClass @BeforeClass
public void setupServerURI() throws Exception { public void setupSecurePort() throws AtlasException {
BaseResourceIT.baseUrl = "https://localhost:21443"; org.apache.commons.configuration.Configuration configuration = ApplicationProperties.get();
} securePort = configuration.getInt(Atlas.ATLAS_SERVER_HTTPS_PORT, ATLAS_DEFAULT_HTTPS_PORT);
@AfterClass
public void resetServerURI() throws Exception {
BaseResourceIT.baseUrl = "http://localhost:21000";
} }
@BeforeMethod @BeforeMethod
...@@ -93,7 +92,7 @@ public class SecureEmbeddedServerTestBase { ...@@ -93,7 +92,7 @@ public class SecureEmbeddedServerTestBase {
jksPath = new Path(Files.createTempDirectory("tempproviders").toString(), "test.jks"); jksPath = new Path(Files.createTempDirectory("tempproviders").toString(), "test.jks");
providerUrl = JavaKeyStoreProvider.SCHEME_NAME + "://file/" + jksPath.toUri(); providerUrl = JavaKeyStoreProvider.SCHEME_NAME + "://file/" + jksPath.toUri();
String baseUrl = "https://localhost:21443/"; String baseUrl = String.format("https://localhost:%d/", securePort);
DefaultClientConfig config = new DefaultClientConfig(); DefaultClientConfig config = new DefaultClientConfig();
Client client = Client.create(config); Client client = Client.create(config);
...@@ -106,7 +105,7 @@ public class SecureEmbeddedServerTestBase { ...@@ -106,7 +105,7 @@ public class SecureEmbeddedServerTestBase {
public void testNoConfiguredCredentialProvider() throws Exception { public void testNoConfiguredCredentialProvider() throws Exception {
try { try {
secureEmbeddedServer = new SecureEmbeddedServer(21443, TestUtils.getWarPath()); secureEmbeddedServer = new SecureEmbeddedServer(securePort, TestUtils.getWarPath());
secureEmbeddedServer.server.start(); secureEmbeddedServer.server.start();
Assert.fail("Should have thrown an exception"); Assert.fail("Should have thrown an exception");
...@@ -125,7 +124,7 @@ public class SecureEmbeddedServerTestBase { ...@@ -125,7 +124,7 @@ public class SecureEmbeddedServerTestBase {
configuration.setProperty(CERT_STORES_CREDENTIAL_PROVIDER_PATH, providerUrl); configuration.setProperty(CERT_STORES_CREDENTIAL_PROVIDER_PATH, providerUrl);
try { try {
secureEmbeddedServer = new SecureEmbeddedServer(21443, TestUtils.getWarPath()) { secureEmbeddedServer = new SecureEmbeddedServer(securePort, TestUtils.getWarPath()) {
@Override @Override
protected PropertiesConfiguration getConfiguration() { protected PropertiesConfiguration getConfiguration() {
return configuration; return configuration;
...@@ -152,7 +151,7 @@ public class SecureEmbeddedServerTestBase { ...@@ -152,7 +151,7 @@ public class SecureEmbeddedServerTestBase {
setupCredentials(); setupCredentials();
try { try {
secureEmbeddedServer = new SecureEmbeddedServer(21443, TestUtils.getWarPath()) { secureEmbeddedServer = new SecureEmbeddedServer(securePort, TestUtils.getWarPath()) {
@Override @Override
protected PropertiesConfiguration getConfiguration() { protected PropertiesConfiguration getConfiguration() {
return configuration; return configuration;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment