@Ignore
  @Test
  public void MoreComplexDependency() throws Exception {
    // Complex test : Full tree resolved from
    // http://repository.jboss.org/maven2/

    WikiPage root = InMemoryPage.makeRoot("RooT");

    PageCrawler crawler = root.getPageCrawler();
    // http://repository.jboss.org/nexus/content/groups/public
    WikiPage page =
        crawler.addPage(
            root,
            PathParser.parse("ClassPath"),
            "!define REMOTE_REPO {http://maven.springframework.org/milestone;  }\n!define LOCAL_REPO {target/repo}\n!artifact org.springframework:spring-core:3.0.0.RC1\n");

    List<String> paths = page.getData().getClasspaths();
    System.out.println(paths);
    assertEquals(
        repoDir
            + "/org/springframework/spring-core/3.0.0.RC1/spring-core-3.0.0.RC1.jar:"
            + repoDir
            + "/org/springframework/spring-asm/3.0.0.RC1/spring-asm-3.0.0.RC1.jar:"
            + repoDir
            + "/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:"
            + repoDir
            + "/org/jboss/logging/com.springsource.org.jboss.logging/2.0.5.GA/com.springsource.org.jboss.logging-2.0.5.GA.jar:"
            + repoDir
            + "/org/jboss/util/com.springsource.org.jboss.util/2.2.9.GA/com.springsource.org.jboss.util-2.2.9.GA.jar",
        paths.get(0));
  }
Exemplo n.º 2
0
 public WikiPage createRemoteRoot() throws Exception {
   remoteRoot = InMemoryPage.makeRoot("RooT");
   PageCrawler crawler = remoteRoot.getPageCrawler();
   crawler.addPage(remoteRoot, PathParser.parse("PageOne"), "page one");
   crawler.addPage(remoteRoot, PathParser.parse("PageOne.ChildOne"), "child one");
   crawler.addPage(remoteRoot, PathParser.parse("PageTwo"), "page two");
   return remoteRoot;
 }
Exemplo n.º 3
0
  public void testImportingWiki() throws Exception {
    localRoot = InMemoryPage.makeRoot("LocalRoot");
    importer.importWiki(localRoot);

    assertEquals(2, localRoot.getChildren().size());
    assertEquals(3, imports.size());
    assertEquals(0, errors.size());
  }
  public void testHasEditLinkForWikiWords() throws Exception {
    MockRequest request = new MockRequest();
    request.setResource("PageOne.PageTwo");
    WikiPage root = InMemoryPage.makeRoot("RooT");

    Responder responder = new NotFoundResponder();
    SimpleResponse response =
        (SimpleResponse) responder.makeResponse(FitNesseUtil.makeTestContext(root), request);

    assertHasRegexp("\"PageOne[.]PageTwo[?]edit\"", response.getContent());
  }
Exemplo n.º 5
0
  @Before
  public void setUp() throws Exception {
    root = InMemoryPage.makeRoot("RooT");
    crawler = root.getPageCrawler();
    errorLogsParentPage = crawler.addPage(root, PathParser.parse("ErrorLogs"));
    request = new MockRequest();
    responder = new TestResponder();
    responder.setFastTest(true);
    context = new FitNesseContext(root);

    receiver = new FitSocketReceiver(0, context.socketDealer);
    context.port = receiver.receiveSocket();
  }
Exemplo n.º 6
0
 @Before
 public void setUp() throws Exception {
   suitePageName = "SuitePage";
   root = InMemoryPage.makeRoot("RooT");
   context = FitNesseUtil.makeTestContext(root);
   crawler = root.getPageCrawler();
   PageData data = root.getData();
   data.setContent(classpathWidgets());
   root.commit(data);
   suite = crawler.addPage(root, PathParser.parse(suitePageName), "This is the test suite\n");
   testPages = new LinkedList<WikiPage>();
   testPage = addTestPage(suite, "TestOne", "My test");
 }
  /**
   * com.sun.jdmk:jmxtools:jar:1.2.1 com.sun.jmx:jmxri:jar:1.2.1 are not available on any repo : Too
   * bad...
   *
   * @throws Exception
   */
  @Ignore("This test is time consuming and not very usefull on Jenkins...")
  @Test(expected = DependencyResolutionException.class)
  public void Spring() throws Exception {
    // Complex test : Full tree resolved from

    WikiPage root = InMemoryPage.makeRoot("RooT");

    PageCrawler crawler = root.getPageCrawler();
    // http://repository.springsource.com/maven/bundles/external;
    WikiPage page =
        crawler.addPage(
            root,
            PathParser.parse("ClassPath"),
            "!define REMOTE_REPO {http://repo1.maven.org/maven2;http://oss.sonatype.org/content/repositories/JBoss/;https://oss.sonatype.org/content/repositories/appfuse-releases/}\n!define LOCAL_REPO {target/repo}\n!artifact org.springframework:spring:2.5.6.SEC02\n");

    List<String> paths = page.getData().getClasspaths();
    System.out.println(paths);
  }
  //	public void testWikiWidgetPlugins() throws Exception {
  //	    String symbolValues = MavenArtifact.class.getName();
  //	    testProperties.setProperty(ComponentFactory.SYMBOL_TYPES, symbolValues);
  @Ignore
  @Test
  public void Junit382NoRemoteRepo() throws Exception {
    // Very simple test : only 1 dependency resolved, jar is a dependency of
    // the current module

    WikiPage root = InMemoryPage.makeRoot("RooT");

    PageCrawler crawler = root.getPageCrawler();

    WikiPage page =
        crawler.addPage(
            root,
            PathParser.parse("ClassPath"),
            "!define LOCAL_REPO {target/repo}\n!artifact junit:junit:3.8.1\n");

    List<?> paths = page.getData().getClasspaths();

    assertEquals(repoDir + "/junit/junit/3.8.1/junit-3.8.1.jar", paths.get(0));
  }
  @Ignore
  @Test
  public void multiplePathIssues() throws Exception {
    // Very simple test : only 1 dependency resolved, jar is a dependency of
    // the current module

    WikiPage root = InMemoryPage.makeRoot("RooT");

    PageCrawler crawler = root.getPageCrawler();

    WikiPage page =
        crawler.addPage(
            root,
            PathParser.parse("ClassPath"),
            "!define REMOTE_REPO {http://repo1.maven.org/maven2/}\n!define LOCAL_REPO {target/repo}\n!artifact junit:junit:3.8.2\n!path target/classes\n");

    List<String> paths = page.getData().getClasspaths();

    assertEquals(repoDir + "/junit/junit/3.8.2/junit-3.8.2.jar", paths.get(0));
    assertEquals("target/classes", paths.get(1));
  }
  @Ignore
  @Test
  public void ComplexDependency() throws Exception {
    // Complex test : Full tree resolved from
    // http://repository.jboss.org/nexus/content/groups/public

    WikiPage root = InMemoryPage.makeRoot("RooT");

    PageCrawler crawler = root.getPageCrawler();

    WikiPage page =
        crawler.addPage(
            root,
            PathParser.parse("ClassPath"),
            "!define REMOTE_REPO { http://repository.jboss.org/nexus/content/groups/public }\n!define LOCAL_REPO {target/repo}\n!artifact org.hibernate:hibernate-core:3.3.0.CR1\n");

    List<String> paths = page.getData().getClasspaths();

    assertEquals(
        repoDir
            + "/org/hibernate/hibernate-core/3.3.0.CR1/hibernate-core-3.3.0.CR1.jar:"
            + repoDir
            + "/antlr/antlr/2.7.6/antlr-2.7.6.jar:"
            + repoDir
            + "/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:"
            + repoDir
            + "/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:"
            + repoDir
            + "/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:"
            + repoDir
            + "/javax/transaction/jta/1.1/jta-1.1.jar:"
            + repoDir
            + "/asm/asm/1.5.3/asm-1.5.3.jar:"
            + repoDir
            + "/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar",
        paths.get(0));
  }
Exemplo n.º 11
0
 public void setUp() throws Exception {
   root = InMemoryPage.makeRoot("RooT");
   crawler = root.getPageCrawler();
 }
Exemplo n.º 12
0
 @Before
 public void setup() throws Exception {
   root = InMemoryPage.makeRoot("RooT");
   context = FitNesseUtil.makeTestContext(root);
 }
Exemplo n.º 13
0
 @Before
 public void setUp() throws Exception {
   root = InMemoryPage.makeRoot("root");
   assertions = new ArrayList<Assertion>();
 }
Exemplo n.º 14
0
 @Before
 public void setUp() throws Exception {
   root = InMemoryPage.makeRoot("root");
   instructions = new ArrayList<Object>();
 }
Exemplo n.º 15
0
 public void createLocalRoot() throws Exception {
   localRoot = InMemoryPage.makeRoot("RooT2");
   pageOne = localRoot.addChildPage("PageOne");
   childPageOne = pageOne.addChildPage("ChildOne");
   pageTwo = localRoot.addChildPage("PageTwo");
 }
 public void setUp() throws Exception {
   root = InMemoryPage.makeRoot("RooT");
   page = root.getPageCrawler().addPage(root, PathParser.parse("PageOne"), "some content");
 }