View Javadoc

1   /*
2    * SymmetricDS is an open source database synchronization solution.
3    *   
4    * Copyright (C) Chris Henson <chenson42@users.sourceforge.net>
5    *
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 3 of the License, or (at your option) any later version.
10   *
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this library; if not, see
18   * <http://www.gnu.org/licenses/>.
19   */
20  package org.jumpmind.symmetric.test;
21  
22  import org.jumpmind.symmetric.SymmetricEngine;
23  
24  /***
25   * Simple test utility class to help with stand-alone testing. Run this class
26   * from your development environment to get a SymmetricDS client and server you
27   * can play with.
28   */
29  public class RunTestEngines {
30  
31      public static void main(String[] args) throws Exception {
32          String[] databases = TestSetupUtil.lookupDatabasePairs(DatabaseTestSuite.DEFAULT_TEST_PREFIX).iterator().next();
33          TestSetupUtil.setup(DatabaseTestSuite.DEFAULT_TEST_PREFIX, TestConstants.TEST_ROOT_DOMAIN_SETUP_SCRIPT,
34                  databases[0], databases[1]);
35          SymmetricEngine root = TestSetupUtil.getRootEngine();
36          SymmetricEngine client = TestSetupUtil.getClientEngine();
37          root.openRegistration(TestConstants.TEST_CLIENT_NODE_GROUP, TestConstants.TEST_CLIENT_EXTERNAL_ID);
38          client.start();
39          while (true) {
40              client.pull();
41              client.push();
42              Thread.sleep(10000);
43          }
44      }
45  
46  }