Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
lvs007 committed Oct 29, 2018
1 parent 86fbffb commit 723f882
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/tron/core/db/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ public void init() {
logger.error(
"Please delete database directory({}) and restart",
Args.getInstance().getOutputDirectory());
System.exit(1);
System.exit(0);
} catch (BadItemException e) {
e.printStackTrace();
logger.error("DB data broken!");
logger.error(
"Please delete database directory({}) and restart",
Args.getInstance().getOutputDirectory());
System.exit(1);
System.exit(0);
}
forkController.init(this);
revokingStore.enable();
Expand Down Expand Up @@ -370,7 +370,7 @@ public void initGenesis() {
logger.error(
"genesis block modify, please delete database directory({}) and restart",
Args.getInstance().getOutputDirectory());
System.exit(1);
System.exit(0);
} else {
logger.info("create genesis block");
Args.getInstance().setChainId(this.genesisBlock.getBlockId().toString());
Expand Down
13 changes: 6 additions & 7 deletions src/test/java/org/tron/core/net/node/BaseNetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.tron.common.application.TronApplicationContext;
import org.tron.common.application.Application;
import org.tron.common.application.ApplicationFactory;
import org.tron.common.application.TronApplicationContext;
import org.tron.common.overlay.client.PeerClient;
import org.tron.common.overlay.server.ChannelManager;
import org.tron.common.overlay.server.SyncPool;
Expand All @@ -40,22 +39,22 @@
@Slf4j
public abstract class BaseNetTest {

protected static TronApplicationContext context;
protected static NodeImpl node;
protected TronApplicationContext context;
protected NodeImpl node;
protected RpcApiService rpcApiService;
protected PeerClient peerClient;
protected ChannelManager channelManager;
protected SyncPool pool;
protected Manager manager;
private Application appT;

private static String dbPath;
private String dbPath;
private String dbDirectory;
private String indexDirectory;

private int port;

private static ExecutorService executorService = Executors.newFixedThreadPool(1);
private ExecutorService executorService = Executors.newFixedThreadPool(1);

public BaseNetTest(String dbPath, String dbDirectory, String indexDirectory, int port) {
this.dbPath = dbPath;
Expand Down Expand Up @@ -108,7 +107,7 @@ public void run() {
NodeDelegate nodeDelegate = new NodeDelegateImpl(manager);
node.setNodeDelegate(nodeDelegate);
pool.init(node);

appT.startup();
rpcApiService.blockUntilShutdown();
}
Expand Down

0 comments on commit 723f882

Please sign in to comment.