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.apache.commons.logging.Log;
23  import org.apache.commons.logging.LogFactory;
24  import org.junit.Assert;
25  import org.junit.Test;
26  import org.springframework.jdbc.core.JdbcTemplate;
27  
28  public class LoadFromClientIntegrationTest extends AbstractIntegrationTest {
29  
30      static final Log logger = LogFactory.getLog(LoadFromClientIntegrationTest.class);
31  
32      public LoadFromClientIntegrationTest() throws Exception {
33      }
34  
35      public LoadFromClientIntegrationTest(String client, String root) throws Exception {
36          super(client, root);
37      }
38  
39      @Test(timeout = 30000)
40      public void registerClientWithRoot() {
41          getRootEngine().openRegistration(TestConstants.TEST_CLIENT_NODE_GROUP, TestConstants.TEST_CLIENT_EXTERNAL_ID);
42          getClientEngine().start();
43          String result = getClientEngine().reloadNode("00000");
44          Assert.assertTrue(result, result.startsWith("Successfully opened initial load for node"));
45          getClientEngine().push();
46          JdbcTemplate jdbcTemplate = getClientDbDialect().getJdbcTemplate();
47          int initialLoadEnabled = jdbcTemplate.queryForInt("select initial_load_enabled from sym_node_security where node_id='00000'");
48          Assert.assertEquals(0, initialLoadEnabled);
49      }
50  
51  }