Commit 716afc53 by Sarath Subramanian

ATLAS-2331: Provide option to start embedded Solr server for Integration Tests

parent 02a618af
......@@ -90,38 +90,6 @@
<artifactId>atlas-intg</artifactId>
</dependency>
<!-- Local SolrRunner Dependencies-->
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
<version>7.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>info.ganglia.gmetric4j</groupId>
<artifactId>gmetric4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
</dependencies>
<build>
......@@ -138,28 +106,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/local_solr</outputDirectory>
<resources>
<resource>
<directory>src/test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -54,6 +54,12 @@
</dependency>
<dependency>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-testtools</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<scope>provided</scope>
......@@ -147,7 +153,6 @@
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
......@@ -161,14 +166,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-common</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......@@ -184,26 +181,21 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>compile</phase>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>unpack</goal>
<goal>copy-resources</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-common</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
<excludes>org/**, META-INF/**</excludes>
<outputDirectory>${project.build.directory}/local_solr</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/solr</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../../test-tools/src/main/resources/solr</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
......
......@@ -18,10 +18,6 @@
package org.apache.atlas.repository.graphdb.janus;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasException;
import org.apache.atlas.repository.graphdb.AtlasGraph;
......@@ -30,18 +26,20 @@ import org.apache.atlas.repository.graphdb.janus.serializer.BigDecimalSerializer
import org.apache.atlas.repository.graphdb.janus.serializer.BigIntegerSerializer;
import org.apache.atlas.repository.graphdb.janus.serializer.StringListSerializer;
import org.apache.atlas.repository.graphdb.janus.serializer.TypeCategorySerializer;
import org.apache.atlas.runner.LocalSolrRunner;
import org.apache.atlas.typesystem.types.DataTypes.TypeCategory;
import org.apache.commons.configuration.Configuration;
import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraphFactory;
import org.janusgraph.core.JanusGraph;
import org.janusgraph.core.JanusGraphFactory;
import org.janusgraph.core.schema.JanusGraphManagement;
import org.janusgraph.core.util.JanusGraphCleanup;
import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
/**
* Default implementation for Graph Provider that doles out Titan Graph.
......@@ -54,11 +52,9 @@ public class AtlasJanusGraphDatabase implements GraphDatabase<AtlasJanusVertex,
* Constant for the configuration property that indicates the prefix.
*/
public static final String GRAPH_PREFIX = "atlas.graph";
public static final String INDEX_BACKEND_CONF = "index.search.backend";
public static final String SOLR_ZOOKEEPER_URL = "atlas.graph.index.search.solr.zookeeper-url";
public static final String INDEX_BACKEND_LUCENE = "lucene";
public static final String INDEX_BACKEND_ES = "elasticsearch";
private static volatile AtlasJanusGraph atlasGraphInstance = null;
......@@ -71,6 +67,8 @@ public class AtlasJanusGraphDatabase implements GraphDatabase<AtlasJanusVertex,
}
public static Configuration getConfiguration() throws AtlasException {
startLocalSolr();
Configuration configProperties = ApplicationProperties.get();
Configuration janusConfig = ApplicationProperties.getSubsetConfiguration(configProperties, GRAPH_PREFIX);
......@@ -166,6 +164,12 @@ public class AtlasJanusGraphDatabase implements GraphDatabase<AtlasJanusVertex,
LOG.warn("Could not clear test JanusGraph", t);
t.printStackTrace();
}
try {
LocalSolrRunner.stop();
} catch (Throwable t) {
LOG.warn("Could not stop local solr server", t);
}
}
@Override
......@@ -173,4 +177,33 @@ public class AtlasJanusGraphDatabase implements GraphDatabase<AtlasJanusVertex,
getGraphInstance();
return atlasGraphInstance;
}
private static void startLocalSolr() {
if (isEmbeddedSolr()) {
try {
LocalSolrRunner.start();
Configuration configuration = ApplicationProperties.get();
configuration.clearProperty(SOLR_ZOOKEEPER_URL);
configuration.setProperty(SOLR_ZOOKEEPER_URL, LocalSolrRunner.getZookeeperUrls());
} catch (Exception e) {
throw new RuntimeException("Failed to start embedded solr cloud server. Aborting!", e);
}
}
}
public static boolean isEmbeddedSolr() {
boolean ret = false;
try {
Configuration conf = ApplicationProperties.get();
Object property = conf.getProperty("atlas.graph.index.search.solr.embedded");
if (property != null && property instanceof String) {
ret = Boolean.valueOf((String) property);
}
} catch (AtlasException ignored) { }
return ret;
}
}
......@@ -25,7 +25,6 @@ import org.apache.atlas.repository.graphdb.AtlasGraph;
import org.apache.atlas.repository.graphdb.AtlasGraphManagement;
import org.apache.atlas.repository.graphdb.AtlasPropertyKey;
import org.apache.atlas.repository.graphdb.AtlasVertex;
import org.apache.atlas.runner.LocalSolrRunner;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
......@@ -34,7 +33,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr;
/**
*
......@@ -52,10 +50,6 @@ public abstract class AbstractGraphDatabaseTest {
@BeforeClass
public static void createIndices() throws Exception {
if (useLocalSolr()) {
LocalSolrRunner.start();
}
GraphSandboxUtil.create();
AtlasJanusGraphDatabase db = new AtlasJanusGraphDatabase();
......@@ -86,13 +80,9 @@ public abstract class AbstractGraphDatabaseTest {
}
@AfterClass
public static void cleanUp() throws Exception {
public static void cleanUp() {
AtlasJanusGraph graph = new AtlasJanusGraph();
graph.clear();
if (useLocalSolr()) {
LocalSolrRunner.stop();
}
}
protected <V, E> void pushChangesAndFlushCache() {
......
......@@ -75,23 +75,12 @@ public class AtlasJanusDatabaseTest {
return (AtlasGraph<V, E>) atlasGraph;
}
@BeforeClass
public void start() throws Exception {
if (useLocalSolr()) {
LocalSolrRunner.start();
}
}
@AfterClass
public void cleanup() throws Exception {
public void cleanup() {
if (atlasGraph != null) {
atlasGraph.clear();
atlasGraph = null;
}
if (useLocalSolr()) {
LocalSolrRunner.stop();
}
}
@Test
......
......@@ -21,14 +21,12 @@ import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasException;
import org.apache.atlas.graph.GraphSandboxUtil;
import org.apache.atlas.repository.graphdb.AtlasGraph;
import org.apache.atlas.runner.LocalSolrRunner;
import org.apache.commons.configuration.Configuration;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr;
@Test
public class JanusGraphProviderTest {
......@@ -38,10 +36,6 @@ public class JanusGraphProviderTest {
@BeforeTest
public void setUp() throws Exception {
if (useLocalSolr()) {
LocalSolrRunner.start();
}
GraphSandboxUtil.create();
//First get Instance
......@@ -62,10 +56,6 @@ public class JanusGraphProviderTest {
} catch (Exception e) {
e.printStackTrace();
}
if (useLocalSolr()) {
LocalSolrRunner.stop();
}
}
@Test
......
......@@ -590,9 +590,9 @@
<entity.repository.impl>org.apache.atlas.repository.audit.InMemoryEntityAuditRepository</entity.repository.impl>
<surefire.version>2.20.1</surefire.version>
<surefire.version>2.18.1</surefire.version>
<surefire.forkCount>2C</surefire.forkCount>
<failsafe.version>2.20.1</failsafe.version>
<failsafe.version>2.18.1</failsafe.version>
<atlas.surefire.options></atlas.surefire.options>
<aspectj.runtime.version>1.8.7</aspectj.runtime.version>
......@@ -657,7 +657,7 @@
<graphdb.backend.impl>org.apache.atlas.repository.graphdb.janus.AtlasJanusGraphDatabase</graphdb.backend.impl>
<graph.index.backend>solr</graph.index.backend>
<tests.solr.embedded>true</tests.solr.embedded>
<distro.exclude.packages>WEB-INF/lib/je-*.jar,WEB-INF/lib/elasticsearch-*.jar</distro.exclude.packages>
<distro.exclude.packages>WEB-INF/lib/je-*.jar,WEB-INF/lib/elasticsearch-*.jar,WEB-INF/lib/solr-test-framework-*.jar</distro.exclude.packages>
</properties>
</profile>
......@@ -712,6 +712,7 @@
<modules>
<module>build-tools</module>
<module>test-tools</module>
<module>intg</module>
<module>common</module>
<module>server-api</module>
......@@ -2123,6 +2124,27 @@
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/solr</outputDirectory>
<resources>
<resource>
<directory>${basedir}/test-tools/src/main/resources/solr</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -164,10 +164,8 @@
<dependencies>
<dependency>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-common</artifactId>
<type>test-jar</type>
<artifactId>atlas-testtools</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
......@@ -189,10 +187,8 @@
<dependencies>
<dependency>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-common</artifactId>
<type>test-jar</type>
<artifactId>atlas-testtools</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
......@@ -214,10 +210,8 @@
<dependencies>
<dependency>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-common</artifactId>
<type>test-jar</type>
<artifactId>atlas-testtools</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
......@@ -257,27 +251,23 @@
</properties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>compile</phase>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>unpack</goal>
<goal>copy-resources</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-common</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
<excludes>org/**, META-INF/**</excludes>
<outputDirectory>${project.build.directory}/local_solr</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/solr</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../test-tools/src/main/resources/solr</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
......
<?xml version="1.0"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.atlas</groupId>
<artifactId>apache-atlas</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>atlas-testtools</artifactId>
<name>Apache Atlas Test Utility Tools</name>
<packaging>jar</packaging>
<dependencies>
<!-- LocalSolrRunner Dependency-->
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
<version>7.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>info.ganglia.gmetric4j</groupId>
<artifactId>gmetric4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/solr</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/classes/solr</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -14,9 +14,10 @@
package org.apache.atlas.runner;
import org.apache.atlas.ApplicationProperties;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.solr.cloud.MiniSolrCloudCluster;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -27,7 +28,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.UUID;
......@@ -35,32 +35,32 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class LocalSolrRunner {
protected static final String[] COLLECTIONS = readCollections();
private static final String TARGET_DIRECTORY = System.getProperty("user.dir") + File.separator + "target";
private static final String COLLECTIONS_FILE = "collections.txt";
private static final String SOLR_XML = "solr.xml";
private static final String TEMPLATE_DIRECTORY = "core-template";
private static final String TARGET_DIRECTORY = System.getProperty("user.dir") + "/target";
private static final String COLLECTIONS_FILE = "/collections.txt";
public static final String ZOOKEEPER_URLS = System.getProperty("index.search.solr.zookeeper-url");
private static final Logger LOG = LoggerFactory.getLogger(LocalSolrRunner.class);
private static MiniSolrCloudCluster miniSolrCloudCluster;
public static void start() throws Exception {
if (ZOOKEEPER_URLS != null) {
if (isLocalSolrRunning()) {
return;
}
String solrHome = TARGET_DIRECTORY + "/local_solr/solr";
File templateDirectory = new File(solrHome + File.separator + TEMPLATE_DIRECTORY);
File temp = new File(TARGET_DIRECTORY + "/data/index/" + getRandomString());
LOG.info("==> LocalSolrRunner.start()");
File templateDirectory = new File(TARGET_DIRECTORY + File.separator + "solr" + File.separator + TEMPLATE_DIRECTORY);
File temp = new File(TARGET_DIRECTORY + File.separator + "data" + File.separator + "index" + File.separator + getRandomString());
temp.mkdirs();
temp.deleteOnExit();
final String solrXml = readXmlFile(solrHome + "/solr.xml", Charset.forName("UTF-8"));
miniSolrCloudCluster = new MiniSolrCloudCluster(1, null, temp.toPath(), readSolrXml(), null, null);
miniSolrCloudCluster = new MiniSolrCloudCluster(1, null, temp.toPath(), solrXml, null, null);
LOG.info("Started local solr server at: " + getZookeeperUrls());
for (String coreName : COLLECTIONS) {
File coreDirectory = new File(temp.getAbsolutePath() + File.separator + coreName);
......@@ -72,32 +72,39 @@ public class LocalSolrRunner {
Path coreConfigPath = Paths.get(coreDirectory.getAbsolutePath());
miniSolrCloudCluster.uploadConfigSet(coreConfigPath, coreName);
}
Configuration configuration = ApplicationProperties.get();
configuration.setProperty("atlas.graph.index.search.solr.zookeeper-url", getZookeeperUrls());
LOG.info("Uploading solr configurations for core: '{}', configPath: '{}'", coreName, coreConfigPath);
}
public static String getZookeeperUrls() {
final String zookeeperUrls;
if (ZOOKEEPER_URLS == null) {
zookeeperUrls = miniSolrCloudCluster.getZkServer().getZkAddress();
} else {
zookeeperUrls = ZOOKEEPER_URLS;
}
return zookeeperUrls;
LOG.info("<== LocalSolrRunner.start()");
}
public static void stop() throws Exception {
if (ZOOKEEPER_URLS != null) {
if (!isLocalSolrRunning()) {
return;
}
System.clearProperty("solr.solrxml.location");
System.clearProperty("zkHost");
miniSolrCloudCluster.shutdown();
}
public static String getZookeeperUrls() {
return miniSolrCloudCluster.getZkServer().getZkAddress();
}
public static boolean isLocalSolrRunning() {
boolean ret = false;
if (miniSolrCloudCluster != null) {
ret = CollectionUtils.isNotEmpty(miniSolrCloudCluster.getJettySolrRunners());
}
return ret;
}
private static String[] readCollections() {
try (InputStream inputStream = LocalSolrRunner.class.getResourceAsStream("/solr" + COLLECTIONS_FILE);
try (InputStream inputStream = LocalSolrRunner.class.getResourceAsStream("/solr" + File.separator + COLLECTIONS_FILE);
BufferedReader buffer = new BufferedReader(new InputStreamReader(inputStream))) {
return Pattern.compile("\\s+").split(buffer.lines().collect(Collectors.joining("\n")));
} catch (IOException e) {
......@@ -105,13 +112,44 @@ public class LocalSolrRunner {
}
}
public static String readXmlFile(String path, Charset encoding) throws IOException {
byte[] encoded = Files.readAllBytes(Paths.get(path));
return new String(encoded, encoding);
private static String readSolrXml() throws IOException {
InputStream inputStream = getClassLoader().getResourceAsStream("solr" + File.separator + SOLR_XML);
if (inputStream == null) {
throw new RuntimeException("Unable to read solr xml");
}
return IOUtils.toString(inputStream, Charset.forName("UTF-8"));
}
private static ClassLoader getClassLoader() {
return Thread.currentThread().getContextClassLoader();
}
private static String getRandomString() {
return UUID.randomUUID().toString();
}
public static void main(String[] args) {
if (ArrayUtils.isEmpty(args)) {
System.out.println("No arguments!");
} else if (args[0].equals("start")) {
try {
start();
System.out.println("Started Local Solr Server: "+ getZookeeperUrls());
} catch (Exception e) {
//do nothing
}
} else if (args[0].equals("stop")) {
try {
stop();
System.out.println("Shutting Local Solr Server.");
} catch (Exception e) {
//do nothing
}
} else {
System.out.println("Bad arguments!");
}
}
}
\ No newline at end of file
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# A1 is set to be a FileAppender.
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=target/test.log
log4j.appender.A1.Threshold=ALL
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c{2}: %m%n
# A2 is a ConsoleAppender.
log4j.appender.A2=org.apache.log4j.ConsoleAppender
log4j.appender.A2.Threshold=ALL
# A2 uses PatternLayout.
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c{2}: %m%n
# Set both appenders (A1 and A2) on the root logger.
#log4j.rootLogger=INFO, A1, A2
log4j.rootLogger=ERROR, A1
......@@ -149,7 +149,7 @@ public class EntityResource {
jsonStrings = new String[jsonEntities.size()];
for (int i = 0; i < jsonEntities.size(); i++) {
jsonStrings[i] = AtlasJson.toV1Json(jsonEntities.get(i));
jsonStrings[i] = jsonEntities.get(i).textValue();
}
} catch (IOException e) {
jsonStrings = new String[1];
......
......@@ -42,7 +42,7 @@ public class AdaptiveWaiterTest {
waiter.pause(new IllegalStateException());
}
assertEquals(waiter.waitDuration, Math.min((pauseCount + 1) * minDuration, maxDuration)); // waiter.waitDuration will be set to wait time for next pause()
assertEquals(waiter.waitDuration, Math.min((pauseCount - 1) * minDuration, maxDuration)); // waiter.waitDuration will be set to wait time for next pause()
}
@Test
......
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