groovy不支持注解

运行环境:win32+eclipse3.4+groovy1.7+jdk1.5

代码如下:

 

public class BuildChargeBillManagerTest extends BaseBizCommonTestCase {
	
	@Override
	public final String[] getConfigurationLocations() {
		return ['META-INF/spring/manager-bean.xml','META-INF/spring/pucprod-db-apayfund.xml','META-INF/spring/pucprod-db-history.xml' ] as String[]
	}
	@Override
	public String[] getResourceFilterNames() {
		return ['pucprod-db-apayfund.xml','pucprod-db-history.xml'] as String[];
	}
	
	@XAutoWire(XAutoWire.BY_NAME)
	protected BuildChargeBillManager buildChargeBillManager
	
	
	public void test_buildChargeBill() {
		def chargeBill=new ChargeBill()
		buildChargeBillManager.buildChargeBill(chargeBill);
	}
}

运行结果:

Class not found com.alipay.pucprod.biz.common.manager.test.BuildChargeBillManagerTest
java.lang.ClassNotFoundException: com.alipay.pucprod.biz.common.manager.test.BuildChargeBillManagerTest
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:425)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


开始一直怀疑是构造路径的问题,试了半天没结果。调试了很长时间,很郁闷就是没有编译后的class文件,在groovy文件中显示eclipse没有错误。

突然想起上次做mock的时候使用注解不支持。赶紧注释了注解,就编译通过啦。

//@XAutoWire(XAutoWire.BY_NAME)
	protected BuildChargeBillManager buildChargeBillManager
	

离开鼠标-firefox键盘控制


PC玩家一般通过鼠标和键盘控制游戏。以射击类游戏为例,玩家一般通过鼠标来控制视角和射击,通过键盘控制人物跳跃,装载弹药或进入游戏菜单。除非是左撇子,玩家一般都采用左手键盘右手鼠标方式。

PC玩家一般通过鼠标和键盘控制游戏。以射击类游戏为例,玩家一般通过鼠标来控制视角和射击,通过键盘控制人物跳跃,装载弹药或进入游戏菜单。除非是左撇子,玩家一般都采用左手键盘右手鼠标方式。

众所周知,很多浏览器也支持键盘快捷键,例如页面上下滚动,重新加载页面或打开标签页切换。

为了使用方便,浏览器快捷键一般位于键盘左侧。但滚动页面时,用户必须使用键盘右侧的方向键,用户就需要用到习惯于控制鼠标的右手。

Gamer’s Control就是专为Firefox用户设计的键盘快捷键插件。通过熟悉的WASD键,玩家们可以轻松执行页面上下滚动和标签页切换操作。R键可以重新加载页面,Q键和E键可以执行向后和/向前操作,C键可以关闭当前标签页。

当然,当Firefox用户需要在页面中输入文字时,Gamer’s Control就会失效。否则,笔者就没有介绍这款插件的必要了。

完整的快捷键列表:

w: 向上滚动

s: 向下滚动

a: 前一标签页

d: 下一标签页

shift+w: 页面顶部

shift+s: 页面底部

space: 向下翻页

shift+space: 向上翻页

q: 向后

e: 向前

r: 刷新

x: 停止加载

f: 新标签页

c: 关闭标签页

shift+c: undo close tab

Gamer’s Control开发者表示,下一版Gamer’s Control将添加快捷键定制功能。如果用户不需要使用某个快捷键,用户可以选择禁用。

据悉,Gamer’s Control支持所有版本的Firefox浏览器,包括最新的Firefox 4。

Gamer’s Control插件安装页面:

https://addons.mozilla.org/en-US/firefox/addon/199427/

离开鼠标-宣言

完全离开鼠标,目前还是很困难的。本文的目标是离开外置鼠标,在全键盘和内置鼠标的协助下完成日常工作。游戏发烧友请无视。

内置鼠标大概三种:

mac 多点触控 这个鼠标很强大。

ibm的触摸球 编程爱好者的习惯。

触摸板式       绝大多数笔记本的配置。

个人测试环境:

ibm触摸球(个人很鄙视thinkpad,长得太丑,又TMD的重。买thinkpad的人给我感觉就是装精,自以为搞技术就了不起。本人是公司发的,将就用用)。

windows xp

B装软件:

文件管理:tc神器

image

文本编辑:vim神辑

image

快捷运行:运行精灵

image

文件索引:everything

image

目前使用就这么多。

真人cs选址

Technorati 标签:

今天陪同学去看他的真人CS项目选址,一路上还拍了些花花草草。

DSC08741

地点是个废弃的中学。

image

因为没人开门,我同学翻墙而入啦。

 

image

当年的教室。

image

如今的养猪场………………

image

image

荒废的操场,长满了杂草。

image

 

image

学校没了,校规还在………

image

当年那些小朋友的科技梦想。

image

当年的小朋友,如今的大姑娘,正在回想小学的早恋情人…………

image

     总体来看这个地址不靠谱,面积太小,结构不好,上下共分三层。就这个地址来看,小学的遗址,也只能给

小朋友玩玩。成年人或者退伍军人在这里玩CS,没跨两步就狭路相逢啦。

回家钓鱼

好不容易休了一次年假。这次年假主要目的还是陪老婆的,这其中也可以偷偷的去钓鱼。

钓鱼地点

钓点

上次发了洪水,大量的鱼从拱桥哪里游到这个小河沟来了。

几个刁莽

钓友-陈凯

钓友-强儿

我的战果

 

 

 

战利品

 

黄辣丁

htc magic 驱动另外一种安装方法

Technorati 标签:

第一次安装一个g2驱动,是在论坛上搜的一个驱动。安装完成后,驱动没有再提示我安装了,但是adb运行不了。

第二次我自己从android的sdk中usb driver中安装,ok啦。

但是上面两个都很麻烦。

今天推荐一个自动安装的方法。一句话:使用驱动人生2010来自动帮你安装。

2010以下的版本无法识别adb驱动。

image

安装完成后:

image

OVER。。

eclipse中集成groovy插件

Technorati 标签:

eclipse插件安装:

在线安装指南:http://docs.codehaus.org/display/GROOVY/Install+Groovy-Eclipse+Plugin

目前兼容eclipse 3.4,3.5,3.6。

3.4和3.6已测。

3.4必须是3.4.2以上版本才能安装。3.4的支持很差:

1:内存消耗过大,经常出现outofmemory。

2:自动导入有问题。如果你在groovy开发的时候,用自动导入功能的话,你会发现你每使用一次,之前已经导入

     的文件会再重复导入一次。

    类似下面:

import org.gmock.GMockTestCase;
import org.gmock.GMockTestCase;
import org.gmock.GMockTestCase;

 

3.6目前支持比较好,建议使用3.6。

 

3.4的问题个人没有找到好的解决方法,只能将自动导入关闭。

 

image

gmock单元测试-项目依赖

Technorati 标签:

groovy做单元测试的好处这里先不讲了。

这里只谈怎么在项目中实现gmock测试。

项目依赖:

<!-- groovy 单元测试 -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>1.7.2</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gmock</groupId>
            <artifactId>gmock</artifactId>
            <version>0.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>1.1</version>
            <scope>test</scope>
        </dependency>

插件依赖:

<build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.0-rc-5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/groovy</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 单元测试覆盖率 -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>

        </plugins>
    </build>

测试故障:

image

出现这个问题是因为在eclipse的项目构造路径中,没有包含groovy文件,只包含了java文件。

image

在pom.xml文件中新增:

 

<build>
    <resources>
        <resource>
            <directory>src/test/groovy</directory>
            <includes>
                <include>**/*.groovy</include>
            </includes>
        </resource>
    </resources>
</build>

测试体:

import org.gmock.GMockTestCase;

/**
* @author mo.duanm
* @version $Id: BuildChargeBillManager.groovy,v 0.1 2010-7-30 涓嬪崍04:14:13 mo.duanm Exp $
*/
public class BuildChargeBillManager extends GMockTestCase{

    void test(){
        println("fuck")
    }

}

测试结果:

 

image

micoblog使用客户端(Windows live writer)编写博客

 

   使用micoblog有一段时间啦。本人比较懒,不喜欢上网站去上写blog。关键一个原因是在网页上写blog的话,突破处理太麻烦。(需要先上传,再复制链接,并且无法排版)。今天和大家分享一下使用客户端写文章。

   1:按照windows live。这里自带了windows live writer。下载

   2:安装。我就不废话啦。

   3:在micoblog服务端设置客户端访问的用户名和密码。

     image

4:设置客户端。

      image

     选择:其他日志服务

  1.     image
  2.     你的blog地址和刚才在服务器设置的用户名密码。

   image

   设置blog提交的地址:http://nbaertuo.appspot.com/xmlrpc.php

    o啦。

    需要设置域名。因为图片链接生成的时候是根据你博客中设置的域名来生成链接的。

  1.    image

firefox中encrypted.google.com 被拦截

此连接是不受信任的

您想使用 Firefox 来安全连接至 encrypted.google.com,但是我们无法确认此连接为安全的。

通常,当您尝试安全连接时,站点会出示受信任的标识,以证明您访问的是正确的地址。然而,现在无法验证此网站的标识。
         
怎么办?


如果您过去连接到此网站并且没有发现问题,那么此错误信息表示可能有人想冒充该网站,所以您应该停止浏览。
         
技术细节


encrypted.google.com 使用了无效的安全证书。

该证书因为其发行者证书未知而不被信任。
该证书仅对 LocalProxyServer 有效。

(错误码: sec_error_unknown_issuer)

         
我已充分了解可能的风险


如果您了解现在所发生的一切,您可以告诉 Firefox 并让它信任此站点的标识。
即使您信任此站点,这个错误还表明可能有人尝试干扰您的连接。
不要随便添加例外,除非您知道并认同该网站不使用受信任标识的理由。

 

这个无法加入到例外。