使用javap分析Java字节码的一个例子
I have the following source code in Java:class Outer { Nested nested; Nested getNested() { &nb
JUnit 注解@Rule的工作原理
Suppose you need to repeatedly execute some test method in your unit test case, for example, you would like to test getPrice based on the first set of test data 5 times in test method test1() while fo
JUnit 注解@SuiteClasses的工作原理
Suppose I have four test cases in my project, the total methods to be tested:Based on the blog Run only given sets of your unit test via @Category, it is possible to organize test methods within
JUnit 注解@Category的工作原理
Suppose you have a large number of unit test cases and you don’t want them to be executed all at the same time during Maven build. You can simply achieve it via annotation @Category.(1) Create empty c
JUnit 注解@RunWith的工作原理
In order to introduce the usage of this annotation in JUnit, I use an example to demonstrate.I have a very simple price calculator:public class PriceCalculator { &nbs
Eclipse里如果看不到Attach Source按钮应该怎么办
When I am creating unit test for one of my Java project A, I try to have a look at the source code of this annotation:Once I press Ctrl and click, I see this message below. The “Attach Source” button
使用JDK工具jmap和jhat监控Java进程
Suppose you have a running Java process and you would like to inspect its running status, for example how many object instance are created or memory consumption status, you can use some standard tool
Java注解@Cacheable的工作原理
In order to avoid unnecessary query on database it is a common pattern to define a cache in application layer to cache the query result from database. See one example below. Here the application cache
使用Eclipse调试PHP应用
(1) Install WAMPServer:Change Apache server default port 80 to another port:configuration: \bin\apache\apache2.4.9\conf\httpd.conf(2) In Eclipse, specify PHP Executable:debug setting:Create a new debu
使用Source Monitor检测Java代码的环复杂度
Today I found a useful free software called “SourceMonitor” which can help to calculate and monitor the java code ( and other programming language like C++, C# etc ) complexity.For the definition and
使用VisualVM进行Java应用的性能测量
Recently I am trying to find a handy tool to measure the performance of my Java application and finally I think the VisualVM provided by JDK is the ideal one. This blog is written based on JDK1.7 + Ec
SAP Fiori应用里出现http request错误的原因分析
Issue: When you try to create a new Opportunity in Fiori, you meet with the following error message in UI:Click “Show Details” hyperlink:Click F12 to open Chrome development tool, you could see more d
使用JAD集成到Eclipse里去,方便地查看任意Java类的源代码
In our JAVA development if there is no source code attached for a class like below,We have no chance to view its source code.However you can use an open source tool, JAD, to decompile the class file s
SAP JCO的下载,安装,配置和使用
This blog can be used as a very simple tutorial for those guys who are new to JCO. It demonstrates how to download and configure the JCO in your laptop. A simple consumption from JAVA side to call a r
Eclipse的代码自动完成(Code Automatic completion)配置
Today my colleague tells me with one tip regarding Eclipse auto completion setting, which I think is useful in my daily life.There are lots of standard classes and those class/method created on my own
如何进行Java的Remote调试
(1) start Jetty server under debug mode via mvn jetty:run(2) In Eclipse, create a new Debug configuration->Remote Java ApplicationSpecify Host as localhost and port 8000:Click debug button:You shou
使用jMeter测试通过SAP ID Service认证的SAP Cloud API
Recently I am working on a co-innovation project with one local partner in China. They will provide a Face Recognition solution which consists of a set of hardware & software. Once a person is rec
如何使用jMeter对需要CSRF token验证的OData服务进行并发性能测试
In my previous blog JMeter beginner – how to use JMeter to measure performance of OData service accessed parallelly I have demonstrate the way how to generate a large number of parallel requ
Java的Covariance设计原理和SAP ABAP的模拟实现
I am the trainer of one standard course “Programming Language Concept” within SAP and there is a set of concept Covariance and Contravariance, which has only built-in support by a subset of programmin
Java和ABAP单例(singleton)设计模式的攻与防
Recently I meet with an issue using Spring which finally turns out that my bean is initialized multiple times although it is expected to be a singleton. As a result I look into the possible scenario t