All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webpieces.webserver.test.OverridesForTestRealServer Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package org.webpieces.webserver.test;

import org.webpieces.templatingdev.api.DevTemplateModule;
import org.webpieces.templatingdev.api.TemplateCompileConfig;

import com.google.inject.Binder;
import com.google.inject.Module;

public class OverridesForTestRealServer implements Module {
	
	private TemplateCompileConfig templateConfig;
	
	public OverridesForTestRealServer() {
		this(new TemplateCompileConfig(OverridesForTest.isGradleRunning()));
	}
	
	public OverridesForTestRealServer(TemplateCompileConfig templateCompileConfig) {
		this.templateConfig = templateCompileConfig;
	}
	
	@Override
	public void configure(Binder binder) {
                //By using the DevTemplateService, we do not need to re-run the gradle build and generate html
                //files every time we change the html code AND instead can just run the test in our IDE.
                //That said, there is a setting when this test runs in gradle that skips this step and runs the
                //production groovy *.class file that will be run in production (ie. the test run in the IDE
                //and run in gradle differ just a little :( )
		binder.install(new DevTemplateModule(templateConfig));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy