Ejemplo n.º 1
0
  @Test
  public void testBasicNameParsing() {
    AspxParser parser = AspxParser.parse(ResourceManager.getDotNetWebFormsFile("WebForm1.aspx"));

    assert parser.aspName.equals("WebForm1.aspx")
        : "Got " + parser.aspName + " instead of WebForm1.aspx.";
  }
  @Test
  public void testResourcesFolder() {
    Map<String, AscxFile> map =
        AscxFileMappingsFileParser.getMap(ResourceManager.getDotNetWebFormsFile(""));

    assert map.containsKey("WebUserControl1") : "Didn't contain WebUserControl1: " + map.keySet();
  }
Ejemplo n.º 3
0
  @Test
  public void testBasicIdParsing() {
    AspxParser parser = AspxParser.parse(ResourceManager.getDotNetWebFormsFile("WebForm1.aspx"));

    assert parser.ids.contains("ddl") : "Parser didn't find ddl: " + parser;
    assert parser.ids.contains("newitem") : "Parser didn't find newitem: " + parser;
    assert parser.ids.contains("test") : "Parser didn't find test: " + parser;
  }
Ejemplo n.º 4
0
  @Test
  public void testProductDetails() {
    File dotNetWebFormsFile = ResourceManager.getDotNetWebFormsFile("ProductDetails.aspx");

    assert dotNetWebFormsFile.isFile()
        : "ChangePassword.aspx was not a file. Path should have been "
            + dotNetWebFormsFile.getAbsolutePath();

    AspxParser parser = AspxParser.parse(dotNetWebFormsFile);

    assertVariablePresence(parser, "txtComment", "txtEmail", "hiddenFieldProductID");
  }
Ejemplo n.º 5
0
  @Test
  public void testChangePassword() {
    File dotNetWebFormsFile = ResourceManager.getDotNetWebFormsFile("ChangePassword.aspx");

    assert dotNetWebFormsFile.isFile()
        : "ChangePassword.aspx was not a file. Path should have been "
            + dotNetWebFormsFile.getAbsolutePath();

    AspxParser parser = AspxParser.parse(dotNetWebFormsFile);

    assertVariablePresence(parser, "txtPassword1", "txtPassword2");
  }
Ejemplo n.º 6
0
  @Test
  public void testRequestParsingInAspx() {
    File dotNetWebFormsFile = ResourceManager.getDotNetWebFormsFile("Message.aspx");

    assert dotNetWebFormsFile.exists() && dotNetWebFormsFile.isFile()
        : "Message.aspx was not found. Path should have been "
            + dotNetWebFormsFile.getAbsolutePath();

    AspxParser parser = AspxParser.parse(dotNetWebFormsFile);

    List<String> strings = parser.parameters;

    assert strings != null : "Parameters were null";
    assert strings.contains("Msg") : "Aspx.cs parser failed to get Msg: " + parser;
  }