Пример #1
0
  @Test
  public void testStaticStr1() throws JAXBException, IOException {
    JAXBElement<?> jaxb =
        (JAXBElement<?>)
            _ds.unmarshal(
                JarTestResourceUtils.readDemoFileAsStream("test/static_test_str1.xml", _ds_cfg));

    DataSetDescr dsd = (DataSetDescr) jaxb.getValue();

    SortGroup sg = dsd.getSortByGrp();
    assertNotNull(sg);
    assertEquals(1, sg.getSortBy().size());
  }
Пример #2
0
  @Test
  public void testDs() throws JAXBException, IOException {

    String[] flist = new String[] {LocalTestConstants.DS_XML, LocalTestConstants.DS_EMPTY_XML};

    HashMap<String, DataSetDescr> dmap = new HashMap<String, DataSetDescr>();

    for (String fname : flist) {
      JAXBElement<?> jaxb =
          (JAXBElement<?>) _ds.unmarshal(JarTestResourceUtils.readDemoFileAsStream(fname, _ds_cfg));
      dmap.put(fname, (DataSetDescr) jaxb.getValue());
    }

    checkDataSetDescrPartial(dmap.get(LocalTestConstants.DS_EMPTY_XML));
    checkDataSetDescrFull(dmap.get(LocalTestConstants.DS_XML));
  }
Пример #3
0
  @Test
  public void testStaticLangDs() throws JAXBException, IOException {
    JAXBElement<?> jaxb =
        (JAXBElement<?>)
            _ds.unmarshal(
                JarTestResourceUtils.readDemoFileAsStream("test/static_test_lmap.xml", _ds_cfg));

    DataSetDescr dsd = (DataSetDescr) jaxb.getValue();

    StaticData sdf = dsd.getStaticData();
    assertEquals(1, sdf.getColumns().getColumn().size());
    assertEquals(2, sdf.getStaticRows().getRow().size());

    LangMap lm = dsd.getLangMap();
    assertNotNull(lm);
    assertEquals(1, lm.getColumn().size());
  }
Пример #4
0
  @BeforeClass
  public static void testReady() throws Exception {
    boolean b = Boolean.parseBoolean(readGetEx(TestConstants.JETTY_SRV_URL + BASE_URL + "/rdy"));

    long dts = System.currentTimeMillis();
    while (!b && (System.currentTimeMillis() - dts) < TestConstants.WAIT_TIME) {
      b = Boolean.parseBoolean(readGetEx(TestConstants.JETTY_SRV_URL + "/rdy"));

      if (b) break;

      Thread.sleep(TestConstants.RESULT_CHECK_TIME);
    }

    assertTrue("WebApp is not ready " + "after " + TestConstants.WAIT_TIME + " msec of waiting", b);

    // Singleton to use under MultiWebIt
    synchronized (lock) {
      if (!fls) {
        // Copy demo ll_set to test project
        JarTestResourceUtils.copyDemoFileToFile(
            LsConstants.LANG_SET_FILE + "_combo",
            TestConstants.WORK_CONFIG_DIR
                + File.separator
                + DsConstants.DS_DIR
                + File.separator
                + LocalTestConstants.TEST_PRJ_NAME
                + File.separator
                + LsConstants.LANG_SET_FILE,
            LangLabelsDaemonTest.LS_CFG);

        fls = true;

        // Activate Bindint
        Class.forName(BindingTest.class.getName());
      }
    }
  }