Commit b37c030d by Shwetha GS

ATLAS-201 Rename org.apache.atlas.Main to org.apache.atlas.Atlas (rishabhbhardwaj via shwethags)

parent fdafb359
...@@ -65,7 +65,7 @@ def main(): ...@@ -65,7 +65,7 @@ def main():
args = ["-app", os.path.join(web_app_dir, "atlas")] args = ["-app", os.path.join(web_app_dir, "atlas")]
args.extend(sys.argv[1:]) args.extend(sys.argv[1:])
process = mc.java("org.apache.atlas.Main", args, metadata_classpath, jvm_opts_list, logdir) process = mc.java("org.apache.atlas.Atlas", args, metadata_classpath, jvm_opts_list, logdir)
mc.writePid(metadata_pid_file, process) mc.writePid(metadata_pid_file, process)
print "Apache Atlas Server started!!!\n" print "Apache Atlas Server started!!!\n"
......
...@@ -48,13 +48,13 @@ class TestMetadata(unittest.TestCase): ...@@ -48,13 +48,13 @@ class TestMetadata(unittest.TestCase):
self.assertTrue(java_mock.called) self.assertTrue(java_mock.called)
if IS_WINDOWS: if IS_WINDOWS:
java_mock.assert_called_with( java_mock.assert_called_with(
'org.apache.atlas.Main', 'org.apache.atlas.Atlas',
['-app', 'metadata_home\\server\\webapp\\atlas'], ['-app', 'metadata_home\\server\\webapp\\atlas'],
'metadata_home\\conf;metadata_home\\server\\webapp\\atlas\\WEB-INF\\classes;metadata_home\\server\\webapp\\atlas\\WEB-INF\\lib\\*;metadata_home\\libext\\*', 'metadata_home\\conf;metadata_home\\server\\webapp\\atlas\\WEB-INF\\classes;metadata_home\\server\\webapp\\atlas\\WEB-INF\\lib\\*;metadata_home\\libext\\*',
['-Datlas.log.dir=metadata_home\\logs', '-Datlas.log.file=application.log', '-Datlas.home=metadata_home', '-Datlas.conf=metadata_home\\conf', '-Xmx1024m', '-XX:MaxPermSize=512m', '-Dlog4j.configuration=atlas-log4j.xml'], 'metadata_home\\logs') ['-Datlas.log.dir=metadata_home\\logs', '-Datlas.log.file=application.log', '-Datlas.home=metadata_home', '-Datlas.conf=metadata_home\\conf', '-Xmx1024m', '-XX:MaxPermSize=512m', '-Dlog4j.configuration=atlas-log4j.xml'], 'metadata_home\\logs')
else: else:
java_mock.assert_called_with( java_mock.assert_called_with(
'org.apache.atlas.Main', 'org.apache.atlas.Atlas',
['-app', 'metadata_home/server/webapp/atlas'], ['-app', 'metadata_home/server/webapp/atlas'],
'metadata_home/conf:metadata_home/server/webapp/atlas/WEB-INF/classes:metadata_home/server/webapp/atlas/WEB-INF/lib/*:metadata_home/libext/*', 'metadata_home/conf:metadata_home/server/webapp/atlas/WEB-INF/classes:metadata_home/server/webapp/atlas/WEB-INF/lib/*:metadata_home/libext/*',
['-Datlas.log.dir=metadata_home/logs', '-Datlas.log.file=application.log', '-Datlas.home=metadata_home', '-Datlas.conf=metadata_home/conf', '-Xmx1024m', '-XX:MaxPermSize=512m', '-Dlog4j.configuration=atlas-log4j.xml'], 'metadata_home/logs') ['-Datlas.log.dir=metadata_home/logs', '-Datlas.log.file=application.log', '-Datlas.home=metadata_home', '-Datlas.conf=metadata_home/conf', '-Xmx1024m', '-XX:MaxPermSize=512m', '-Dlog4j.configuration=atlas-log4j.xml'], 'metadata_home/logs')
......
...@@ -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-201 Rename org.apache.atlas.Main to org.apache.atlas.Atlas (rishabhbhardwaj via shwethags)
ATLAS-179 Atlas hook causes mem leak and hive server 2 crashes (shwethags) ATLAS-179 Atlas hook causes mem leak and hive server 2 crashes (shwethags)
ATLAS-212 Remove test class usage of hive configuration property "atlas.rest.address" (jspeidel via shwethags) ATLAS-212 Remove test class usage of hive configuration property "atlas.rest.address" (jspeidel via shwethags)
ATLAS-159 UI generated files should be target (sanjayp via sumasai) ATLAS-159 UI generated files should be target (sanjayp via sumasai)
......
...@@ -35,8 +35,8 @@ import java.util.Iterator; ...@@ -35,8 +35,8 @@ import java.util.Iterator;
/** /**
* Driver for running Metadata as a standalone server with embedded jetty server. * Driver for running Metadata as a standalone server with embedded jetty server.
*/ */
public final class Main { public final class Atlas {
private static final Logger LOG = LoggerFactory.getLogger(Main.class); private static final Logger LOG = LoggerFactory.getLogger(Atlas.class);
private static final String APP_PATH = "app"; private static final String APP_PATH = "app";
private static final String APP_PORT = "port"; private static final String APP_PORT = "port";
private static final String ATLAS_HOME = "atlas.home"; private static final String ATLAS_HOME = "atlas.home";
...@@ -66,7 +66,7 @@ public final class Main { ...@@ -66,7 +66,7 @@ public final class Main {
/** /**
* Prevent users from constructing this. * Prevent users from constructing this.
*/ */
private Main() { private Atlas() {
} }
protected static CommandLine parseArgs(String[] args) throws ParseException { protected static CommandLine parseArgs(String[] args) throws ParseException {
......
...@@ -24,32 +24,32 @@ import org.testng.annotations.Test; ...@@ -24,32 +24,32 @@ import org.testng.annotations.Test;
/** /**
* *
*/ */
public class MainIT { public class AtlasIT {
@Test @Test
public void testPortSelection () throws Exception { public void testPortSelection () throws Exception {
PropertiesConfiguration config = new PropertiesConfiguration(); PropertiesConfiguration config = new PropertiesConfiguration();
// test ports via config // test ports via config
config.setProperty(Main.ATLAS_SERVER_HTTP_PORT, 21001); config.setProperty(Atlas.ATLAS_SERVER_HTTP_PORT, 21001);
config.setProperty(Main.ATLAS_SERVER_HTTPS_PORT, 22443); config.setProperty(Atlas.ATLAS_SERVER_HTTPS_PORT, 22443);
int port = Main.getApplicationPort(Main.parseArgs(new String[] {}), "false", int port = Atlas.getApplicationPort(Atlas.parseArgs(new String[] {}), "false",
config ); config );
Assert.assertEquals(21001, port, "wrong http port"); Assert.assertEquals(21001, port, "wrong http port");
port = Main.getApplicationPort(Main.parseArgs(new String[] {}), "true", port = Atlas.getApplicationPort(Atlas.parseArgs(new String[] {}), "true",
config ); config );
Assert.assertEquals(22443, port, "wrong https port"); Assert.assertEquals(22443, port, "wrong https port");
// test defaults // test defaults
port = Main.getApplicationPort(Main.parseArgs(new String[] {}), "false", port = Atlas.getApplicationPort(Atlas.parseArgs(new String[] {}), "false",
new PropertiesConfiguration() ); new PropertiesConfiguration() );
Assert.assertEquals(21000, port, "wrong http port"); Assert.assertEquals(21000, port, "wrong http port");
port = Main.getApplicationPort(Main.parseArgs(new String[] {}), "true", port = Atlas.getApplicationPort(Atlas.parseArgs(new String[] {}), "true",
new PropertiesConfiguration() ); new PropertiesConfiguration() );
Assert.assertEquals(21443, port, "wrong https port"); Assert.assertEquals(21443, port, "wrong https port");
// test command line override // test command line override
CommandLine commandLine = Main.parseArgs(new String[] {"--port", "22000"}); CommandLine commandLine = Atlas.parseArgs(new String[] {"--port", "22000"});
port = Main.getApplicationPort(commandLine, "true", config); port = Atlas.getApplicationPort(commandLine, "true", config);
Assert.assertEquals(22000, port, "wrong https port"); Assert.assertEquals(22000, port, "wrong https port");
port = Main.getApplicationPort(commandLine, "false", config); port = Atlas.getApplicationPort(commandLine, "false", config);
Assert.assertEquals(22000, port, "wrong https port"); Assert.assertEquals(22000, port, "wrong https port");
} }
} }
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