@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testCompileErrorOpt() throws Exception { jsUriMock = mockJsUri(false); // opt realCompMock = mockRealJsCompiler(JS_ERROR, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(true); // force compiler to run compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertTrue(actual.getErrors().get(0).contains(ERROR_NAME)); assertEquals(1, actual.getErrors().size()); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testCompileErrorOpt() throws Exception { jsUriMock = mockJsUri(false); // opt realCompMock = mockRealJsCompiler(JS_ERROR, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(true); // force compiler to run compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertTrue(actual.getErrors().get(0).contains(ERROR_NAME)); assertEquals(1, actual.getErrors().size()); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testCompileErrorDeb() throws Exception { jsUriMock = mockJsUri(true); // debug realCompMock = mockRealJsCompiler(JS_ERROR, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(true); // force compiler to run realResultMock = mockRealJsResult(); compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertTrue(actual.getErrors().get(0).contains(ERROR_NAME)); assertEquals(1, actual.getErrors().size()); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testCompileErrorDeb() throws Exception { jsUriMock = mockJsUri(true); // debug realCompMock = mockRealJsCompiler(JS_ERROR, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(true); // force compiler to run realResultMock = mockRealJsResult(); compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertTrue(actual.getErrors().get(0).contains(ERROR_NAME)); assertEquals(1, actual.getErrors().size()); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @SuppressWarnings("unchecked") @Test public void testCompileSuccessOptWithProfiling() throws Exception { jsUriMock = mockJsUri(false); // opt realOptionsMock = new CompilerOptions(); realOptionsMock.enableExternExports(false); realOptionsMock.sourceMapOutputPath = "test.out"; realOptionsMock.sourceMapFormat = Format.V2; realOptionsMock.sourceMapDetailLevel = SourceMap.DetailLevel.ALL; realOptionsMock.ideMode = false; realOptionsMock.convertToDottedProperties = true; for (Map.Entry<String, String> compilerTest : COMPILER_IO.entrySet()) { List<JsContent> content = newJsContents(compilerTest.getKey()); exportResponseMock = mockJsResponse(compilerTest.getKey()); compilerMock = mockDefaultJsCompiler(exportResponseMock, content); compiler = newProfilingClosureJsCompiler(realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, content, EXTERN); assertEquals(compilerTest.getValue(), actual.toJsString()); assertTrue(actual.getErrors().isEmpty()); } }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @SuppressWarnings("unchecked") @Test public void testCompileSuccessOptWithProfiling() throws Exception { jsUriMock = mockJsUri(false); // opt realOptionsMock = new CompilerOptions(); realOptionsMock.enableExternExports(false); realOptionsMock.sourceMapOutputPath = "test.out"; realOptionsMock.sourceMapFormat = Format.V2; realOptionsMock.sourceMapDetailLevel = SourceMap.DetailLevel.ALL; realOptionsMock.ideMode = false; realOptionsMock.convertToDottedProperties = true; for (Map.Entry<String, String> compilerTest : COMPILER_IO.entrySet()) { List<JsContent> content = newJsContents(compilerTest.getKey()); exportResponseMock = mockJsResponse(compilerTest.getKey()); compilerMock = mockDefaultJsCompiler(exportResponseMock, content); compiler = newProfilingClosureJsCompiler(realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, content, EXTERN); assertEquals(compilerTest.getValue(), actual.toJsString()); assertTrue(actual.getErrors().isEmpty()); } }
@Test public void testCompileSuccessOpt() throws Exception { jsUriMock = mockJsUri(false); // opt realResultMock = mockRealJsResult(); realCompMock = mockRealJsCompiler(null, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(false); compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertEquals(ACTUAL_COMPILER_OUTPUT, actual.toJsString()); assertTrue(actual.getErrors().isEmpty()); }
@Test public void testCompileSuccessDeb() throws Exception { jsUriMock = mockJsUri(true); // debug realResultMock = mockRealJsResult(); realCompMock = mockRealJsCompiler(null, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(false); compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertEquals(EXPORT_COMPILER_STRING, actual.toJsString()); assertTrue(actual.getErrors().isEmpty()); }
@Test public void testCompileSuccessOpt() throws Exception { jsUriMock = mockJsUri(false); // opt realResultMock = mockRealJsResult(); realCompMock = mockRealJsCompiler(null, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(false); compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertEquals(ACTUAL_COMPILER_OUTPUT, actual.toJsString()); assertTrue(actual.getErrors().isEmpty()); }
@Test public void testCompileSuccessDeb() throws Exception { jsUriMock = mockJsUri(true); // debug realResultMock = mockRealJsResult(); realCompMock = mockRealJsCompiler(null, realResultMock, ACTUAL_COMPILER_OUTPUT); realOptionsMock = mockRealJsCompilerOptions(false); compiler = newClosureJsCompiler(realCompMock, realOptionsMock, compilerMock, cacheMock); JsResponse actual = compiler.compile(jsUriMock, EXPORT_COMPILER_CONTENTS, EXTERN); assertEquals(EXPORT_COMPILER_STRING, actual.toJsString()); assertTrue(actual.getErrors().isEmpty()); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testGetJsContentWithGoogSymbolExports() throws Exception { realOptionsMock = mockRealJsCompilerOptions(true); // with compiler = newClosureJsCompiler(null, realOptionsMock, compilerMock, cacheMock); FeatureBundle bundle = mockBundle(EXPORTS); Iterable<JsContent> actual = compiler.getJsContent(mockJsUri(false), bundle); assertEquals(EXPORT_COMPILER_STRING + "goog.exportSymbol('bar', bar);\n" + "goog.exportSymbol('foo', foo);\n", getContent(actual)); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testGetJsContentWithGoogSymbolExports() throws Exception { realOptionsMock = mockRealJsCompilerOptions(true); // with compiler = newClosureJsCompiler(null, realOptionsMock, compilerMock, cacheMock); FeatureBundle bundle = mockBundle(EXPORTS); Iterable<JsContent> actual = compiler.getJsContent(mockJsUri(false), bundle); assertEquals(EXPORT_COMPILER_STRING + "goog.exportSymbol('bar', bar);\n" + "goog.exportSymbol('foo', foo);\n", getContent(actual)); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testGetJsContentWithoutGoogSymbolExports() throws Exception { realOptionsMock = mockRealJsCompilerOptions(false); // without compiler = newClosureJsCompiler(null, realOptionsMock, compilerMock, cacheMock); FeatureBundle bundle = mockBundle(EXPORTS); Iterable<JsContent> actual = compiler.getJsContent(mockJsUri(false), bundle); assertEquals(EXPORT_COMPILER_STRING, getContent(actual)); }
@Ignore("This class was not being run and when I ran it this test did not pass. Not familiar enough to enable it.") @Test public void testGetJsContentWithoutGoogSymbolExports() throws Exception { realOptionsMock = mockRealJsCompilerOptions(false); // without compiler = newClosureJsCompiler(null, realOptionsMock, compilerMock, cacheMock); FeatureBundle bundle = mockBundle(EXPORTS); Iterable<JsContent> actual = compiler.getJsContent(mockJsUri(false), bundle); assertEquals(EXPORT_COMPILER_STRING, getContent(actual)); }