Examples of FileInfo


Examples of com.google.jstestdriver.FileInfo

  public void testWriteFileInfos() throws Exception {
    Set<FileInfoScheme> defaultSchemes = Sets.<FileInfoScheme>newHashSet(new HttpFileInfoScheme());

    TestFileUtil testFileUtil = new TestFileUtil(createFileCache(
      new FileInfo("/foo.js", 0, 0, false, false, null, "foo.js"),
      new FileInfo("/serveonly.js", 0, 0, false, true, null, "/serveonly.js"),
      new FileInfo("/bar.js", 0, 0, false, false, null, "bar.js"),
      new FileInfo("http://somehost/bar.js", 0, 0, false, false, null, "http://somehost/bar.js")
      ),
      new NullPathPrefix(), defaultSchemes, new Gson());

    final List<String> paths = Lists.newArrayList();
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

 
  public void testWriteFileInfosWindowsPath() throws Exception {
    Set<FileInfoScheme> defaultSchemes = Sets.<FileInfoScheme>newHashSet(new HttpFileInfoScheme());

    TestFileUtil testFileUtil = new TestFileUtil(createFileCache(
      new FileInfo("C:\\Sagitta\\Main\\Source\\Web\\Sagitta.Web.JavaScriptTests\\lib\\jasmine\\jasmine.js",
        0, 0, false, false, null, "/test/lib/jasmine/jasmine.js")),
      new NullPathPrefix(), defaultSchemes, new Gson());

    StringWriter writer = new StringWriter();
    HtmlWriter htmlWriter = new HtmlWriter(writer, new NullPathPrefix());
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

        return unhandledPath.equals(path);
      }
    });

    TestFileUtil testFileUtil = new TestFileUtil(createFileCache(
      new FileInfo("/foo.js", 0, 0, false, false, null, "foo.js"),
      new FileInfo("/serveonly.js", 0, 0, false, true, null, "/serveonly.js"),
      new FileInfo("/bar.js", 0, 0, false, false, null, "bar.js"),
      new FileInfo(unhandledPath, 0, 0, false, false, null, unhandledPath),
      new FileInfo("http://somehost/bar.js", 0, 0, false, false, null, "http://somehost/bar.js")
      ),
      new NullPathPrefix(), schemes, new Gson());

    final List<String> paths = Lists.newArrayList();
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

        new NullPathPrefix(), Collections.<FileInfoScheme>emptySet(), new Gson()), false));
  }

  public void testWriteResources() throws IOException {
    Map<String, FileInfo> files = Maps.newHashMap();
    FileInfo fileInfo = new FileInfo("foo.js", -1, -1, false, false, "", "foo.js");
    NullPathPrefix prefix = new NullPathPrefix();
    Set<FileInfoScheme> schemes = Collections.<FileInfoScheme>emptySet();
    JstdTestCaseStore store = new JstdTestCaseStore();
    String id = "foo";
    store.addCase(new JstdTestCase(Collections.<FileInfo>emptyList(), Lists.newArrayList(fileInfo),
        Collections.<FileInfo>emptyList(), id));
    RunnerPage page = new RunnerPage(new TestFileUtil(store, prefix, schemes, new Gson()), false);
   
    Map<String, String> properties = Maps.newHashMap();
    properties.put(SlavePageRequest.TESTCASE_ID, id);
    SlavePageRequest request =
        new SlavePageRequest(properties, null, prefix, null);
    CharArrayWriter writer = new CharArrayWriter();
    final HtmlWriter htmlWriter = new HtmlWriter(writer, prefix);
    page.render(htmlWriter, request);
    String html = writer.toString();
    String jsonFileInfo = new Gson().toJson(fileInfo.toFileSource(prefix, schemes));

    assertTrue(jsonFileInfo + " is not found in " + html, html.contains(jsonFileInfo));
  }
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

    FileCacheHandler handler = new FileCacheHandler(
        request, response, gson, new HashSet<FileInfo>(), new FileSetCacheStrategy());
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    PrintWriter writer = new PrintWriter(out);

    FileInfo info = new FileInfo("asdf", 1, -1, false, true, "data", "asdf");

    EasyMock.expect(request.getParameter("fileSet"))
        .andReturn(gson.toJson(new FileInfo[] {info}));
    EasyMock.expect(response.getWriter()).andReturn(writer);
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

* @author corbinrsmith@gmail.com (Cory Smith)
*/
public class CoverageInstrumentingProcessorTest extends TestCase {

  public void testInstrument() throws Exception {
    FileInfo fileInfo = new FileInfo("foo.js", 0, -1, true, false, "var a = 1;", "foo.js");
    String expected = "decorated";
    Code code = new Code(fileInfo.getFilePath(), fileInfo.getData());
    CoverageAccumulator accumulator = new CoverageAccumulator();
    final Instant instant = new Instant(System.currentTimeMillis());
    FileInfo decorated =
        new CoverageInstrumentingProcessor(new DecoratorStub(expected, code),
            Collections.<String>emptySet(), accumulator, new Time() {
              public Instant now() {
                return instant;
              }
            }).process(fileInfo);
    assertEquals(expected, decorated.getData());
    assertEquals(fileInfo.getFilePath(), decorated.getFilePath());
    assertEquals(instant.getMillis(), decorated.getTimestamp());
    assertEquals(fileInfo.isServeOnly(), decorated.isServeOnly());
  }
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

    assertEquals(instant.getMillis(), decorated.getTimestamp());
    assertEquals(fileInfo.isServeOnly(), decorated.isServeOnly());
  }

  public void testSkipInstrument() throws Exception {
    FileInfo lcov = new FileInfo("LCOV.js", 0, -1, true, false, "var a = 1;", "LCOV.js");
    FileInfo serveOnly = new FileInfo("someData.dat", 0, -1, true, true, "scally{wag}", "someData.dat");
    FileInfo excluded = new FileInfo("excluded.dat", 0, -1, true, false, "not{me}", "excluded.dat");
    FileInfo remote = new FileInfo("https://foobar", 0, -1, true, false, null, "https://foobar");
    FileInfo empty = new FileInfo("foobar.js", 0, -1, true, false, "\n", "foobar.js");
    CoverageInstrumentingProcessor processor =
        new CoverageInstrumentingProcessor(null,
            Sets.<String>newHashSet(excluded.getFilePath()),
            null, null);
    assertSame(lcov, processor.process(lcov));
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

    Set<FileInfo> fileInfos = slave.getFileSet();

    assertEquals(3, fileInfos.size());
    Iterator<FileInfo> iterator = fileInfos.iterator();

    FileInfo info1 = iterator.next();

    assertEquals("filename1.js", info1.getFilePath());
    assertEquals(123, info1.getTimestamp());

    FileInfo info2 = iterator.next();

    assertEquals("filename2.js", info2.getFilePath());
    assertEquals(456, info2.getTimestamp());

    FileInfo info3 = iterator.next();

    assertEquals("filename3.js", info3.getFilePath());
    assertEquals(789, info3.getTimestamp());
  }
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);

    slave.addFiles(Lists.newArrayList(new FileInfo()), new LoadedFiles());
    Response response = new Response();
    response.setType(ResponseType.RESET_RESULT.name());
    response.setResponse(new Gson().toJson(new LoadedFiles()));
    response.setBrowser(new BrowserInfo());
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

    }
  }

  public void testAggregateresponses() throws Exception {
    FileInfo one = new FileInfo("one", -1, -1, false, false, null, "one");
    ResponseStream streamOne = new NoopStream();
    ResponseStream streamTwo = new NoopStream();
    final RunData runDataOne = new RunData(Lists
        .newArrayList(streamOne), Collections.<JstdTestCase> emptyList(), null);
    final RunData runDataTwo = new RunData(Lists
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.