@Before public void setUp() throws Exception { cacheMock = new MockProvider(); exportResponseMock = mockJsResponse(EXPORT_COMPILER_STRING); compilerMock = mockDefaultJsCompiler(exportResponseMock, EXPORT_COMPILER_CONTENTS); executorServiceMock = EasyMock.createMock(ExecutorService.class); EasyMock.makeThreadSafe(executorServiceMock, true); }
@Before public void setUp() throws Exception { cacheMock = new MockProvider(); exportResponseMock = mockJsResponse(EXPORT_COMPILER_STRING); compilerMock = mockDefaultJsCompiler(exportResponseMock, EXPORT_COMPILER_CONTENTS); executorServiceMock = EasyMock.createMock(ExecutorService.class); EasyMock.makeThreadSafe(executorServiceMock, true); }
@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()); } }