Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
b0aa0e84
Commit
b0aa0e84
authored
May 15, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置打包时不进行测试
parent
4482ad96
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
172 additions
and
155 deletions
+172
-155
pom.xml
pom.xml
+43
-31
DemoVo.java
yzg-util-base/src/test/java/base/DemoVo.java
+29
-29
TestObjectHelper.java
yzg-util-base/src/test/java/base/TestObjectHelper.java
+42
-41
TestByteHelper.java
yzg-util-base/src/test/java/helper/TestByteHelper.java
+32
-32
TestDateAutoHelper.java
yzg-util-base/src/test/java/helper/TestDateAutoHelper.java
+21
-21
WebAspect.java
...ud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
+5
-1
No files found.
pom.xml
View file @
b0aa0e84
...
@@ -34,15 +34,15 @@
...
@@ -34,15 +34,15 @@
<guava.version>
20.0
</guava.version>
<guava.version>
20.0
</guava.version>
</properties>
</properties>
<!-- <scm>-->
<!-- <scm>-->
<!-- <connection>scm:git:git://github.com/spring-projects/spring-boot.git/spring-boot-starters/spring-boot-starter-amqp</connection>-->
<!-- <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>-->
<!-- <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>-->
<!-- <url>http://github.com/spring-projects/spring-boot/spring-boot-starters/spring-boot-starter-amqp</url>-->
<!-- </scm>-->
<!-- </scm>-->
<!-- <issueManagement>-->
<!-- <issueManagement>-->
<!-- <system>Github</system>-->
<!-- <system>Github</system>-->
<!-- <url>https://github.com/spring-projects/spring-boot/issues</url>-->
<!-- <url>https://github.com/spring-projects/spring-boot/issues</url>-->
<!-- </issueManagement>-->
<!-- </issueManagement>-->
<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependencies>
...
@@ -150,9 +150,42 @@
...
@@ -150,9 +150,42 @@
</distributionManagement>
</distributionManagement>
<build>
<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>
<finalName>
${project.artifactId}
</finalName>
<pluginManagement>
<pluginManagement>
<plugins>
<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>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
...
@@ -167,6 +200,7 @@
...
@@ -167,6 +200,7 @@
<source>
${maven.compiler.source}
</source>
<source>
${maven.compiler.source}
</source>
<target>
${maven.compiler.target}
</target>
<target>
${maven.compiler.target}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</configuration>
</plugin>
</plugin>
<!-- ===========可运行Jar包=========== -->
<!-- ===========可运行Jar包=========== -->
...
@@ -184,27 +218,5 @@
...
@@ -184,27 +218,5 @@
</plugin>
</plugin>
</plugins>
</plugins>
</pluginManagement>
</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>
</build>
</project>
</project>
\ No newline at end of file
yzg-util-base/src/test/java/base/DemoVo.java
View file @
b0aa0e84
//
package base;
package
base
;
//
//
//
public class DemoVo {
public
class
DemoVo
{
//
/**
/**
//
* 编号,主键请放第一个
* 编号,主键请放第一个
//
*/
*/
//
private String id;
private
String
id
;
//
/**
/**
//
* 接口对象(通联,携程等)
* 接口对象(通联,携程等)
//
*/
*/
//
private String name;
private
String
name
;
//
//
public String getId() {
public
String
getId
()
{
//
return id;
return
id
;
//
}
}
//
//
public void setId(String id) {
public
void
setId
(
String
id
)
{
//
this.id = id;
this
.
id
=
id
;
//
}
}
//
//
public String getName() {
public
String
getName
()
{
//
return name;
return
name
;
//
}
}
//
//
public void setName(String name) {
public
void
setName
(
String
name
)
{
//
this.name = name;
this
.
name
=
name
;
//
}
}
//
}
}
yzg-util-base/src/test/java/base/TestObjectHelper.java
View file @
b0aa0e84
//package base;
package
base
;
//
//import com.yanzuoguang.util.base.ObjectHelper;
import
com.yanzuoguang.util.base.ObjectHelper
;
//import org.junit.Assert;
import
org.junit.Assert
;
//import org.junit.Test;
import
org.junit.Test
;
//
//public class TestObjectHelper {
public
class
TestObjectHelper
{
//
// @Test
@Test
// public void testRead() {
public
void
testRead
()
{
// String id = "123";
System
.
out
.
println
(
"执行测试用例"
);
// String name = "颜佐光";
String
id
=
"123"
;
//
String
name
=
"颜佐光"
;
// DemoVo demo = new DemoVo();
// demo.setId(id);
DemoVo
demo
=
new
DemoVo
();
// demo.setName(name);
demo
.
setId
(
id
);
//
demo
.
setName
(
name
);
// Object idTo = ObjectHelper.get(demo, "id");
// Object nameTo = ObjectHelper.get(demo, "name");
Object
idTo
=
ObjectHelper
.
get
(
demo
,
"id"
);
//
Object
nameTo
=
ObjectHelper
.
get
(
demo
,
"name"
);
// Assert.assertEquals(id, idTo);
// Assert.assertEquals(name, nameTo);
Assert
.
assertEquals
(
id
,
idTo
);
// }
Assert
.
assertEquals
(
name
,
nameTo
);
//
}
//
// @Test
// public void testWrite() {
@Test
// String id = "123";
public
void
testWrite
()
{
// String name = "颜佐光";
String
id
=
"123"
;
//
String
name
=
"颜佐光"
;
// DemoVo demo = new DemoVo();
// ObjectHelper.set(demo, "id", id);
DemoVo
demo
=
new
DemoVo
();
// ObjectHelper.set(demo, "name", name);
ObjectHelper
.
set
(
demo
,
"id"
,
id
);
//
ObjectHelper
.
set
(
demo
,
"name"
,
name
);
// Object idTo = ObjectHelper.get(demo, "id");
// Object nameTo = ObjectHelper.get(demo, "name");
Object
idTo
=
ObjectHelper
.
get
(
demo
,
"id"
);
//
Object
nameTo
=
ObjectHelper
.
get
(
demo
,
"name"
);
// Assert.assertEquals(id, idTo);
// Assert.assertEquals(name, nameTo);
Assert
.
assertEquals
(
id
,
idTo
);
// }
Assert
.
assertEquals
(
name
,
nameTo
);
//}
}
}
yzg-util-base/src/test/java/helper/TestByteHelper.java
View file @
b0aa0e84
//
package helper;
package
helper
;
//
//
import com.yanzuoguang.util.helper.ByteHelper;
import
com.yanzuoguang.util.helper.ByteHelper
;
//
import org.junit.Assert;
import
org.junit.Assert
;
//
import org.junit.Test;
import
org.junit.Test
;
//
//
public class TestByteHelper {
public
class
TestByteHelper
{
//
@Test
@Test
//
public void test() {
public
void
test
()
{
//
long from = 0x0f0f;
long
from
=
0x0f0f
;
//
//
from = 1999;
// from = 1999;
//
//
System.out.println(from);
System
.
out
.
println
(
from
);
//
System.out.println(ByteHelper.reverse(from));
System
.
out
.
println
(
ByteHelper
.
reverse
(
from
));
//
System.out.println(ByteHelper.reverse(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.toHL(from)));
System
.
out
.
println
(
ByteHelper
.
toHexString
(
ByteHelper
.
toHL
(
from
)));
//
System.out.println(ByteHelper.toHexString(ByteHelper.toLH(from)));
System
.
out
.
println
(
ByteHelper
.
toHexString
(
ByteHelper
.
toLH
(
from
)));
//
System.out.println(ByteHelper.toLongByHL(ByteHelper.toHL(from)));
System
.
out
.
println
(
ByteHelper
.
toLongByHL
(
ByteHelper
.
toHL
(
from
)));
//
System.out.println(ByteHelper.toLongByLH(ByteHelper.toLH(from)));
System
.
out
.
println
(
ByteHelper
.
toLongByLH
(
ByteHelper
.
toLH
(
from
)));
//
}
}
//
//
@Test
@Test
//
public void test1() {
public
void
test1
()
{
//
long old = 1999;
long
old
=
1999
;
//
old = 0x0f0f;
old
=
0x0f0f
;
//
long from = ByteHelper.reverse(old);
long
from
=
ByteHelper
.
reverse
(
old
);
//
long to = ByteHelper.reverse(from);
long
to
=
ByteHelper
.
reverse
(
from
);
//
//
Assert.assertEquals(old, to);
// Assert.assertEquals(old, to);
//
System.out.println(String.format("old:%d %d %d", old, from, to));
System
.
out
.
println
(
String
.
format
(
"old:%d %d %d"
,
old
,
from
,
to
));
//
}
}
//
}
}
yzg-util-base/src/test/java/helper/TestDateAutoHelper.java
View file @
b0aa0e84
//
package helper;
package
helper
;
//
//
import com.yanzuoguang.util.helper.DateAutoHelper;
import
com.yanzuoguang.util.helper.DateAutoHelper
;
//
import org.junit.Assert;
import
org.junit.Assert
;
//
import org.junit.Test;
import
org.junit.Test
;
//
//
import java.text.ParseException;
import
java.text.ParseException
;
//
//
public class TestDateAutoHelper {
public
class
TestDateAutoHelper
{
//
//
@Test
@Test
//
public void testGetAutoDate() throws ParseException {
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"
,
"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 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: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"
).
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 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
(
"19871104"
).
toString
());
//
Assert.assertEquals("Wed Nov 04 00:00:00 CST 1987", DateAutoHelper.getAutoDate("04/11/1987").toString());
Assert
.
assertEquals
(
"Wed Nov 04 00:00:00 CST 1987"
,
DateAutoHelper
.
getAutoDate
(
"04/11/1987"
).
toString
());
//
}
}
//
}
}
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
View file @
b0aa0e84
...
@@ -100,7 +100,11 @@ public class WebAspect extends BaseRequestAspect {
...
@@ -100,7 +100,11 @@ public class WebAspect extends BaseRequestAspect {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
ex
=
e
;
ex
=
e
;
result
=
ExceptionHelper
.
getError
(
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
;
return
result
;
}
else
{
}
else
{
throw
e
;
throw
e
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment