Example #1
0
 @Test
 public void testReturnNullWhenNoProperty() throws Exception {
   sm.register(SOURCE, testFile);
   Source source = sm.getSource(SOURCE);
   assertNull(source.getFileProperty("skjbnskb"));
   assertNull(source.getProperty("skjbnskb"));
 }
Example #2
0
  @Test
  public void testAssociateStringProperty() throws Exception {
    sm.register(SOURCE, testFile);
    Source source = sm.getSource(SOURCE);
    String statistics = "statistics";
    String rcStr = associateString(source, statistics);

    assertEquals(sm.getSource(SOURCE).getStringPropertyNames().length, 1);

    sm.saveStatus();

    sm.shutdown();
    sm.init();

    assertEquals(sm.getSource(SOURCE).getStringPropertyNames().length, 1);

    String statsContent = source.getProperty(statistics);
    assertEquals(statsContent, rcStr);
  }