Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding gtengine to benchmark #7

Open
PerfectCarl opened this issue Oct 1, 2013 · 1 comment
Open

Adding gtengine to benchmark #7

PerfectCarl opened this issue Oct 1, 2013 · 1 comment

Comments

@PerfectCarl
Copy link

I want to add gtengine to the template framework benchmark

So I need to code a simple class that would instantiate a gtengine template engine, give a collection of Item as an input parameter and execute the thing.

Here's an example of code for another template engine

        // Some template engine specific code
        Properties p = new Properties();
        p.put("log.enabled", false);
        p.put("feature.smart_escape.enabled", false);
        p.put("feature.transform.enabled", false);

        // here we go 
        engine = new RythmEngine(p);

        // Parameters
        String tmpl = "path/to/my/template.rythm.html" ; 
        List<Stock> items = ...
        OutputStream o1 = ... 

        // Get the template output in the output stream o1  
        engine.render(o1, tmpl, items);
        o1.close();

Could you help me writing the code for gtengine ?

@PerfectCarl
Copy link
Author

I started implementing it hacking code from the unit tests.
Could have a look over my code ?
For the moment, it doesn't work :
I got the following exception :

gtengine:
     [java] Exception in thread "main" java.lang.NoClassDefFoundError: teb/gtengine (wrong name: teb/Gtengine)
     [java]     at java.lang.ClassLoader.defineClass1(Native Method)
     [java]     at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
     [java]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
     [java]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
     [java]     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
     [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
     [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     [java]     at play.template2.GTTemplateInstanceFactoryLive$CL.loadClass(GTTemplateInstanceFactoryLive.java:55)
     [java]     at play.template2.compile.GTJavaCompileToClass$1.isPackage(GTJavaCompileToClass.java:253)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.isPackage(LookupEnvironment.java:1403)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.findPackage(PackageBinding.java:77)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:196)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2376)
     [java]     at org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:69)
     [java]     at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:132)
     [java]     at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:208)
     [java]     at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:186)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1222)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:893)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:1042)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:300)
     [java]     at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:205)
     [java]     at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:739)
     [java]     at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:381)
     [java]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
     [java]     at play.template2.compile.GTJavaCompileToClass.compile(GTJavaCompileToClass.java:283)
     [java]     at play.template2.compile.GTCompiler.compile(GTCompiler.java:87)
     [java]     at play.template2.GTTemplateRepo.compileTemplate(GTTemplateRepo.java:296)
     [java]     at play.template2.GTTemplateRepo.getTemplateInstance(GTTemplateRepo.java:185)
     [java]     at play.template2.GTTemplateRepo.getTemplateInstance(GTTemplateRepo.java:140)
     [java]     at teb.Gtengine.renderToString(Gtengine.java:81)
     [java]     at teb.Gtengine.execute(Gtengine.java:53)
     [java]     at teb._BenchBase.run(_BenchBase.java:72)
     [java]     at teb.Gtengine.main(Gtengine.java:98)
     [java] Java Result: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant