Commit b0aa0e84 authored by yanzg's avatar yanzg

设置打包时不进行测试

parent 4482ad96
......@@ -34,15 +34,15 @@
<guava.version>20.0</guava.version>
</properties>
<!-- <scm>-->
<!-- <connection>scm:git:git://github.com/spring-projects/spring-boot.git/spring-boot-starters/spring-boot-starter-amqp</connection>-->
<!-- <developerConnection>scm:git:ssh://git@github.com/spring-projects/spring-boot.git/spring-boot-starters/spring-boot-starter-amqp</developerConnection>-->
<!-- <url>http://github.com/spring-projects/spring-boot/spring-boot-starters/spring-boot-starter-amqp</url>-->
<!-- </scm>-->
<!-- <issueManagement>-->
<!-- <system>Github</system>-->
<!-- <url>https://github.com/spring-projects/spring-boot/issues</url>-->
<!-- </issueManagement>-->
<!-- <scm>-->
<!-- <connection>scm:git:git://github.com/spring-projects/spring-boot.git/spring-boot-starters/spring-boot-starter-amqp</connection>-->
<!-- <developerConnection>scm:git:ssh://git@github.com/spring-projects/spring-boot.git/spring-boot-starters/spring-boot-starter-amqp</developerConnection>-->
<!-- <url>http://github.com/spring-projects/spring-boot/spring-boot-starters/spring-boot-starter-amqp</url>-->
<!-- </scm>-->
<!-- <issueManagement>-->
<!-- <system>Github</system>-->
<!-- <url>https://github.com/spring-projects/spring-boot/issues</url>-->
<!-- </issueManagement>-->
<dependencyManagement>
<dependencies>
......@@ -150,9 +150,42 @@
</distributionManagement>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
<testResource>
<directory>src/main/resources</directory>
</testResource>
</testResources>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<!-- springboot打包忽略Test单元测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- ===========只打源码包,应用于公共组件打包=========== -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -167,6 +200,7 @@
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- ===========可运行Jar包=========== -->
......@@ -184,27 +218,5 @@
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
<testResource>
<directory>src/main/resources</directory>
</testResource>
</testResources>
</build>
</project>
\ No newline at end of file
//package base;
//
//
//public class DemoVo {
// /**
// * 编号,主键请放第一个
// */
// private String id;
// /**
// * 接口对象(通联,携程等)
// */
// private String name;
//
// public String getId() {
// return id;
// }
//
// public void setId(String id) {
// this.id = id;
// }
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//}
package base;
public class DemoVo {
/**
* 编号,主键请放第一个
*/
private String id;
/**
* 接口对象(通联,携程等)
*/
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
//package base;
//
//import com.yanzuoguang.util.base.ObjectHelper;
//import org.junit.Assert;
//import org.junit.Test;
//
//public class TestObjectHelper {
//
// @Test
// public void testRead() {
// String id = "123";
// String name = "颜佐光";
//
// DemoVo demo = new DemoVo();
// demo.setId(id);
// demo.setName(name);
//
// Object idTo = ObjectHelper.get(demo, "id");
// Object nameTo = ObjectHelper.get(demo, "name");
//
// Assert.assertEquals(id, idTo);
// Assert.assertEquals(name, nameTo);
// }
//
//
// @Test
// public void testWrite() {
// String id = "123";
// String name = "颜佐光";
//
// DemoVo demo = new DemoVo();
// ObjectHelper.set(demo, "id", id);
// ObjectHelper.set(demo, "name", name);
//
// Object idTo = ObjectHelper.get(demo, "id");
// Object nameTo = ObjectHelper.get(demo, "name");
//
// Assert.assertEquals(id, idTo);
// Assert.assertEquals(name, nameTo);
// }
//}
package base;
import com.yanzuoguang.util.base.ObjectHelper;
import org.junit.Assert;
import org.junit.Test;
public class TestObjectHelper {
@Test
public void testRead() {
System.out.println("执行测试用例");
String id = "123";
String name = "颜佐光";
DemoVo demo = new DemoVo();
demo.setId(id);
demo.setName(name);
Object idTo = ObjectHelper.get(demo, "id");
Object nameTo = ObjectHelper.get(demo, "name");
Assert.assertEquals(id, idTo);
Assert.assertEquals(name, nameTo);
}
@Test
public void testWrite() {
String id = "123";
String name = "颜佐光";
DemoVo demo = new DemoVo();
ObjectHelper.set(demo, "id", id);
ObjectHelper.set(demo, "name", name);
Object idTo = ObjectHelper.get(demo, "id");
Object nameTo = ObjectHelper.get(demo, "name");
Assert.assertEquals(id, idTo);
Assert.assertEquals(name, nameTo);
}
}
//package helper;
//
//import com.yanzuoguang.util.helper.ByteHelper;
//import org.junit.Assert;
//import org.junit.Test;
//
//public class TestByteHelper {
// @Test
// public void test() {
// long from = 0x0f0f;
//// from = 1999;
//
// System.out.println(from);
// System.out.println(ByteHelper.reverse(from));
// System.out.println(ByteHelper.reverse(ByteHelper.reverse(from)));
// System.out.println(ByteHelper.toHexString(ByteHelper.toHL(from)));
// System.out.println(ByteHelper.toHexString(ByteHelper.toHL(from)));
// System.out.println(ByteHelper.toHexString(ByteHelper.toLH(from)));
// System.out.println(ByteHelper.toLongByHL(ByteHelper.toHL(from)));
// System.out.println(ByteHelper.toLongByLH(ByteHelper.toLH(from)));
// }
//
// @Test
// public void test1() {
// long old = 1999;
// old = 0x0f0f;
// long from = ByteHelper.reverse(old);
// long to = ByteHelper.reverse(from);
//// Assert.assertEquals(old, to);
// System.out.println(String.format("old:%d %d %d", old, from, to));
// }
//}
package helper;
import com.yanzuoguang.util.helper.ByteHelper;
import org.junit.Assert;
import org.junit.Test;
public class TestByteHelper {
@Test
public void test() {
long from = 0x0f0f;
// from = 1999;
System.out.println(from);
System.out.println(ByteHelper.reverse(from));
System.out.println(ByteHelper.reverse(ByteHelper.reverse(from)));
System.out.println(ByteHelper.toHexString(ByteHelper.toHL(from)));
System.out.println(ByteHelper.toHexString(ByteHelper.toHL(from)));
System.out.println(ByteHelper.toHexString(ByteHelper.toLH(from)));
System.out.println(ByteHelper.toLongByHL(ByteHelper.toHL(from)));
System.out.println(ByteHelper.toLongByLH(ByteHelper.toLH(from)));
}
@Test
public void test1() {
long old = 1999;
old = 0x0f0f;
long from = ByteHelper.reverse(old);
long to = ByteHelper.reverse(from);
// Assert.assertEquals(old, to);
System.out.println(String.format("old:%d %d %d", old, from, to));
}
}
//package helper;
//
//import com.yanzuoguang.util.helper.DateAutoHelper;
//import org.junit.Assert;
//import org.junit.Test;
//
//import java.text.ParseException;
//
//public class TestDateAutoHelper {
//
// @Test
// public void testGetAutoDate() throws ParseException {
// Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", "Wed Nov 04 00:00:00 CST 1987");
// Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("1987-11-04").toString());
// Assert.assertEquals("Wed Nov 04 12:50:00 CST 1987", DateAutoHelper.getAutoDate("1987-11-04 12:50").toString());
// Assert.assertEquals("Wed Nov 04 12:50:15 CST 1987", DateAutoHelper.getAutoDate("1987-11-04 12:50:15").toString());
// Assert.assertEquals("Wed Nov 04 12:50:15 CST 1987", DateAutoHelper.getAutoDate("1987-11-04 12:50:15.000").toString());
// Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("19871104").toString());
// Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("04/11/1987").toString());
// }
//}
package helper;
import com.yanzuoguang.util.helper.DateAutoHelper;
import org.junit.Assert;
import org.junit.Test;
import java.text.ParseException;
public class TestDateAutoHelper {
@Test
public void testGetAutoDate() throws ParseException {
Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", "Wed Nov 04 00:00:00 CST 1987");
Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("1987-11-04").toString());
Assert.assertEquals("Wed Nov 04 12:50:00 CST 1987", DateAutoHelper.getAutoDate("1987-11-04 12:50").toString());
Assert.assertEquals("Wed Nov 04 12:50:15 CST 1987", DateAutoHelper.getAutoDate("1987-11-04 12:50:15").toString());
Assert.assertEquals("Wed Nov 04 12:50:15 CST 1987", DateAutoHelper.getAutoDate("1987-11-04 12:50:15.000").toString());
Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("19871104").toString());
Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("04/11/1987").toString());
}
}
......@@ -100,7 +100,11 @@ public class WebAspect extends BaseRequestAspect {
} catch (Exception e) {
ex = e;
result = ExceptionHelper.getError(e);
if (getReturnType(joinPoint).getTypeName().indexOf(ResponseResult.class.getName()) > -1) {
Type returnType = getReturnType(joinPoint);
if (returnType instanceof Class) {
System.out.println(returnType.getClass());
}
if (returnType.getTypeName().indexOf(ResponseResult.class.getName()) > -1) {
return result;
} else {
throw e;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment