Skip to content

Commit

Permalink
[update] update testUserListMix method of ControllerTest and reformat…
Browse files Browse the repository at this point in the history
… the repository
  • Loading branch information
brianway committed Aug 24, 2016
1 parent cf8c096 commit 2d51317
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 29 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
<version>1.4.9</version>
</dependency>


</dependencies>
</dependencyManagement>
</project>
2 changes: 1 addition & 1 deletion spring-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<artifactId>spring-aspects</artifactId>
</dependency>

<dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.brianway.learning.spring.aop.aspectj.advanced;

import com.brianway.learning.spring.aop.aspectj.Monitorable;
import com.brianway.learning.spring.aop.aspectj.Waiter;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class TestAspect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class Transformer implements ClassFileTransformer {
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
throws IllegalClassFormatException {
System.out.println("Hello "+className+"!");
System.out.println("Hello " + className + "!");
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import com.lowagie.text.Document;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import static com.lowagie.text.FontFactory.TIMES_ROMAN;
import com.lowagie.text.Phrase;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.BaseFont;

import com.lowagie.text.pdf.PdfWriter;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.web.servlet.view.document.AbstractPdfView;
Expand Down
6 changes: 1 addition & 5 deletions spring-mvc/src/main/resources/conf/applicationContext.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

</beans>
8 changes: 4 additions & 4 deletions spring-mvc/src/main/webapp/WEB-INF/views/success.jsp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>操作成功</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>操作成功</title>
</head>
<body>
操作成功!
操作成功!
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
<body>
<spring:bind path="user.*">
<c:forEach var="error" items="${status.errorMessages}">
<B><CSS color=RED>
<BR><c:out value="${error}"/>
</CSS></B>
<B>
<CSS color=RED>
<BR><c:out value="${error}"/>
</CSS>
</B>
</c:forEach>
</spring:bind>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,20 @@ public void testUserListMix() {
String url = URL_PREFIX + "userListMix";
RestTemplate restTemplate = new RestTemplate();

//默认使用jsp
String responseJsp = restTemplate.getForObject(url, String.class);
Assert.assertNotNull(responseJsp);
System.out.println(responseJsp);

//根据请求参数"format"
String responseJson = restTemplate.getForObject(url + "?format=json", String.class);
String responseJson2 = restTemplate.getForObject(url + ".json", String.class);
Assert.assertNotNull(responseJson);
Assert.assertNotNull(responseJson2);
System.out.println(responseJson);
System.out.println(responseJson2);

String responseXml = restTemplate.getForObject(url + "?format=xml", String.class);
String responseXml2 = restTemplate.getForObject(url + ".xml", String.class);
//根据文件拓展名
String responseXml = restTemplate.getForObject(url + ".xml", String.class);
Assert.assertNotNull(responseXml);
Assert.assertNotNull(responseXml2);
System.out.println(responseXml);
System.out.println(responseXml2);
}

}

0 comments on commit 2d51317

Please sign in to comment.