Package org.jostraca.section

Examples of org.jostraca.section.SectionSet.addSection()



  public void testHasSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.hasSection( "s1" ) );
    assertTrue( !ss1.hasSection( "s2" ) );
    assertTrue( !ss1.hasSection( null ) );
  }
View Full Code Here



  public void appendToSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    ss1.appendToSection( "s1", "a" );
    assertTrue( ss1.hasSection( "s1" ) );
    assertEquals( "a", ss1.getSection( "s1").getContent() );
    ss1.appendToSection( "s1", "b" );
    assertEquals( "ab", ss1.getSection( "s1").getContent() );
View Full Code Here


  public void testClearSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    ss1.appendToSection( "s1", "a" );
    assertTrue( ss1.hasSection( "s1" ) );
    assertEquals( "a", ss1.getSection( "s1").getContent() );
    ss1.clearSection( "s1" );
    assertEquals( "", ss1.getSection( "s1").getContent() );
View Full Code Here

  public void testClearAllSections() {
    Section    s1  = new BasicSection( "s1" );
    Section    s2  = new BasicSection( "s2" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    ss1.appendToSection( "s1", "1" );
    ss1.appendToSection( "s2", "2" );
    assertTrue( ss1.hasSection( "s1" ) );
    assertTrue( ss1.hasSection( "s2" ) );
    assertEquals( "1", ss1.getSection( "s1").getContent() );
View Full Code Here


  public void testGetSection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.hasSection( "s1" ) );
    assertEquals( s1, ss1.getSection( "s1" ) );
    assertEquals( "", ss1.getSection( "s2" ).getContent() );
  }
View Full Code Here


  public void isEmptySection() {
    Section    s1  = new BasicSection( "s1" );
    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1 );
    assertTrue( ss1.isEmptySection( "s1" ) );
    ss1.appendToSection( "s1", "a" );
    assertTrue( !ss1.isEmptySection( "s1" ) );
    ss1.clearSection( "s1" );
    assertTrue( ss1.isEmptySection( "s1" ) );
View Full Code Here

    assertTrue( !s1a.equals(s2a) );
    assertTrue( !s1b.equals(s2b) );

    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1a );
    ss1.addSection( s1b );

    SectionSet ss2 = new SectionSet();

    assertTrue( !ss1.equals(ss2) );
View Full Code Here

    assertTrue( !s1a.equals(s2a) );
    assertTrue( !s1b.equals(s2b) );

    SectionSet ss1 = new SectionSet();
    ss1.addSection( s1a );
    ss1.addSection( s1b );

    SectionSet ss2 = new SectionSet();

    assertTrue( !ss1.equals(ss2) );
View Full Code Here

    SectionSet ss2 = new SectionSet();

    assertTrue( !ss1.equals(ss2) );

    ss2.addSection( s1a );
    ss2.addSection( s1b );

    assertEquals( ss1, ss2 );
  }
View Full Code Here

    SectionSet ss2 = new SectionSet();

    assertTrue( !ss1.equals(ss2) );

    ss2.addSection( s1a );
    ss2.addSection( s1b );

    assertEquals( ss1, ss2 );
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.