我正在尝试在我的索尼爱立信K790i上调试J2ME应用程序,这是一台带有最新Netbeans,J2ME SDK,Sony SDK等的Windows XP上的JP-7手机.
我可以通过USB连接并使用SE Device Explorer.当我从设备资源管理器启动我的应用程序时,它只提供一个异常名称(ArrayOutOfBoundsException)和一个带有"unknown"列表的调用堆栈.有没有办法将调用堆栈转换为过程和行#?有没有办法创建调试二进制文件或任何方式来获得更多提示?我的应用程序在模拟器上正常启动.它甚至可以安装在手机上,但是当我运行它时,它完全没有信息而崩溃.
我甚至试过使用我的手机支持的On Device Debug但是我得到OAFcode = 45 EXEcode = 28并且调试会话永远不会启动.虽然它确实在我的手机中创建了一个tempNNNN应用程序.
任何有用的想法都是受欢迎的.
我的Yii应用程序在控制器,模型,组件,模块中获得phpunit覆盖,但没有任何视图.问题是phpunit中的代码覆盖率加载器在准备覆盖率报告期间包含视图文件.具有表单的视图具有$this->beginWidget导致崩溃的调用,因为没有$ this上下文.
视图实际上没有重要的代码或逻辑,但它们仍然有一些条件甚至循环调用,renderPartial因此最好也可以获得视图代码.
有这个问题的解决方案吗?
假设我有一个动作:
function actionShowItem($id)
{
$item = Item::model()->findByPk($id);
$this->render("showitem",array('model' => $id));
}
Run Code Online (Sandbox Code Playgroud)
此操作的简单单元测试是什么,它将验证视图输出中的文本.它在zend框架中很容易,不使用硒.我们可以在zend中创建假的GET和POST.但我在Yii中没有找到相同的例子.请建议.
我的jenkins安装工作正常只是我的代码上的phpunit +覆盖完成了5分钟 - 因为文件太多了.
对我来说,只是知道我的最后一次提交是否破坏了构建,这太过分了.
有什么方法可以在jenkins空闲时运行特殊构建(或计划),而只有在该构建中它才会创建phpunit代码覆盖率报告?
我可以phpunit -c with-coverage.xml在cron中运行但是它与jenkins隔离,它不会刷新jenkin的工作主页.
我的组件:
componentDidMount() {
// Make HTTP reques with Axios
axios.get(APIConfig.api_profile()).then((res) => {
// Set state with result
this.setState(res.data);
console.log('I was triggered during componentDidMount')
console.log(res)
});
}
Run Code Online (Sandbox Code Playgroud)
我的测试:
//@see https://github.com/ctimmerm/axios-mock-adapter
mock.onGet(APIConfig.api_profile()).reply(200, {
"id_user": "1",
"id_person": "1",
"imageUrl": "",
"email": "xyz@zyz.com",
"name": "xyz xyz"
});
test('xyz', async() => {
var ProfilePic2 =require('../../src/views/ProfilePic');
const component = renderer.create(
<ProfilePic/>
);
expect(component.state).toBeDefined();
//tree.props.setProfile({})
let tree = component.toJSON();
await expect(tree).toMatchSnapshot();
});
Run Code Online (Sandbox Code Playgroud)
问题是 jest 正在测试初始渲染,而我需要在收到 API 响应后对其进行测试。因此,它所比较的快照也大多是空的。
我无法让测试等到第二次渲染之后。我只是在尝试等待/异步但无法让它工作。我可以看到我的 api mocs 是从控制台日志中调用的。
尝试运行yarn test并尝试了许多版本的节点(8 和 11),反应(57,58),但无法修复此错误。
FAIL __tests__/index.ios.js
? Test suite failed to run
/xyz/mobile-react/node_modules/react-native/jest/setup.js: babel-plugin-jest-hoist: The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.
Invalid variable access: MockNativeMethods
Whitelisted objects: Array, ArrayBuffer, Boolean, DataView, Date, Error, EvalError, Float32Array, Float64Array, Function, Generator, GeneratorFunction, Infinity, Int16Array, Int32Array, Int8Array, InternalError, Intl, JSON, Map, Math, NaN, Number, Object, Promise, Proxy, RangeError, ReferenceError, Reflect, RegExp, Set, String, Symbol, SyntaxError, TypeError, URIError, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray, WeakMap, WeakSet, arguments, expect, jest, …Run Code Online (Sandbox Code Playgroud) unit-testing ×4
phpunit ×3
jestjs ×2
php ×2
yii ×2
axios ×1
debugging ×1
java ×1
java-me ×1
javascript ×1
jenkins ×1
react-native ×1
reactjs ×1