diff --git a/directjngine/src/main/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGenerator.java b/directjngine/src/main/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGenerator.java index 6de0505..d04fcc1 100644 --- a/directjngine/src/main/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGenerator.java +++ b/directjngine/src/main/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGenerator.java @@ -167,7 +167,7 @@ private static boolean fileContentEquals(File file, String code) throws IOExcept return false; } - private static String getDebugFileName( String file ) { + protected static String getDebugFileName( String file ) { return file.replaceFirst( ".js$" , "-debug.js" ); } } diff --git a/directjngine/src/test/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGeneratorTest.java b/directjngine/src/test/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGeneratorTest.java index 0c3df85..2da0975 100644 --- a/directjngine/src/test/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGeneratorTest.java +++ b/directjngine/src/test/java/com/softwarementors/extjs/djn/jscodegen/CodeFileGeneratorTest.java @@ -2,33 +2,19 @@ import org.testng.annotations.Test; -import java.lang.reflect.Method; - -import static org.testng.Assert.*; +import static org.testng.Assert.assertEquals; public class CodeFileGeneratorTest { - private String getDebugFileName(String file) { - try { - Method method = CodeFileGenerator.class.getDeclaredMethod("getDebugFileName", String.class); - method.setAccessible(true); - Object result = method.invoke(null, file); - return (String) result; - } catch (Exception e) { - e.printStackTrace(); - return ""; - } - } - @Test public void getDebugFileNameTest() { assertEquals( "john.jspiner", - getDebugFileName("john.jspiner") + CodeFileGenerator.getDebugFileName("john.jspiner") ); assertEquals( "app-debug.js", - getDebugFileName("app.js") + CodeFileGenerator.getDebugFileName("app.js") ); } } \ No newline at end of file