Package org.jostraca

Examples of org.jostraca.BasicTemplatePath.resolve()


      // HACK
      // try to load from template path
      catch( Throwable t ) {
        BasicTemplatePath includeRef = new BasicTemplatePath( pPath );
        includeRef.resolve( tmps.getList( Property.main_TemplatePath, Standard.COMMA  ));
        includeFilePath = includeRef.getTemplatePath();
        includeContent = FileUtil.readFile( includeFilePath, ( onlyifexists ? FileUtil.EMPTY_IF_IO_ERROR : FileUtil.FAIL_ON_IO_ERROR ) );
      }

      pTemplate.addFileBuildResource( includeFilePath );
View Full Code Here


    BasicTemplate tm = new BasicTemplate();
    tm.setPropertySet( Constants.CONF_system, systemps );

    String            tmfp = base+"/basic.jtm";
    BasicTemplatePath tmp01  = new BasicTemplatePath( tmfp );
    tmp01.resolve( new String[]{} );

    tm.load( tmp01 );

    //System.out.println( Constants.CONF_system+":\n"+tm.getPropertySet( Constants.CONF_system ) );
    //System.out.println( Constants.CONF_template+" after:\n"+tm.getPropertySet( Constants.CONF_template ) );
View Full Code Here

      fail();
    } catch( IllegalArgumentException e ) {}

    try {
      btp.setTemplateName( "nonexistent-file.txt" );
      btp.resolve( new String[] {} );
      fail();
    } catch( TemplateException tpe ) {
      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }
View Full Code Here

      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }

    try {
      btp.setTemplateName( "/tmp" );
      btp.resolve( new String[] {} );
      fail();
    } catch( TemplateException tpe ) {
      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }
View Full Code Here

      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }

    try {
      btp.setTemplateName( "src/org/jostraca/test/file.txt" );
      btp.resolve( new String[] {} );
      assertEquals( "src/org/jostraca/test/file.txt", btp.getTemplateName() );
      assertEquals( "file.txt", btp.getTemplateFileName() );
      btp.resolve( new String[] {} );
    } catch( TemplateException tpe ) {
      tpe.printStackTrace();
View Full Code Here

    try {
      btp.setTemplateName( "src/org/jostraca/test/file.txt" );
      btp.resolve( new String[] {} );
      assertEquals( "src/org/jostraca/test/file.txt", btp.getTemplateName() );
      assertEquals( "file.txt", btp.getTemplateFileName() );
      btp.resolve( new String[] {} );
    } catch( TemplateException tpe ) {
      tpe.printStackTrace();
      fail();
    }
View Full Code Here

    } catch( IllegalArgumentException e ) {}


    try {
      btp.setTemplateNameFromFile( "nonexistent-file.txt", "nonexistant-folder/filelist.txt"  );
      btp.resolve( new String[] {} );
      fail();
    } catch( TemplateException tpe ) {
      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }
View Full Code Here

    }

    // REVIEW: file.txt is found because it exists  - is this good?
    try {
      btp.setTemplateNameFromFile( "src/org/jostraca/test/file.txt", "nonexistent-folder/filelist.txt"  );
      btp.resolve( new String[] {} );
    } catch( TemplateException tpe ) {
      fail();
    }
    try {
      btp.setTemplateNameFromFile( "some-file.txt", "nonexistent-folder/filelist.txt"  );
View Full Code Here

    } catch( TemplateException tpe ) {
      fail();
    }
    try {
      btp.setTemplateNameFromFile( "some-file.txt", "nonexistent-folder/filelist.txt"  );
      btp.resolve( new String[] {} );
      fail();
    } catch( TemplateException tpe ) {
      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }
View Full Code Here

    }


    try {
      btp.setTemplateNameFromFile( "nonexistent-file.txt", "src/org/jostraca/test/folder/filelist.txt" );
      btp.resolve( new String[] {} );
      fail();
    } catch( TemplateException tpe ) {
      assertEquals( StandardException.Code.CAT_user, tpe.getCat() );
    }
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.