我有一个使用非标准源文件夹布局的项目,如下所示:
sourceSets {
androidTest {
manifest.srcFile "/myproject/androidTest/AndroidManifest.xml"
java {
srcDirs = [
"/myproject/androidTest/java"
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
Android studio 很好地显示了上述源文件夹,并在树中将其标记为“androidTest”。问题现在开始于像 espresso 这样的依赖项在任何测试中都没有解决(在 AS 中找不到类)——尽管它们已经像这样正确声明了:
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Run Code Online (Sandbox Code Playgroud)
如果我将“androidTestImplementation”更改为“implementation”,Android Studio 将恢复并能够解决依赖项(但我不想将测试依赖项添加到我的实现范围!)
这只是 Android Studio 3.2.1 中的错误还是我的设置中存在错误?
由于WURFL用户代理数据库已经商业化,因此浏览器用户代理似乎没有公共中央数据库.因为我没有自己的Iphone4,如果有人可以回答我这个简单的问题和/或指向我的WURFL替代方案,那将会非常有帮助:)
那么 - iPhone 4s的User-Agent字符串是什么?它与iPhone4版本有什么不同吗?
我的 Web 应用程序有多个身份验证管理器(一个用于 API,一个用于 WEB 访问)。api 应该只有一个基本的身份验证服务 - 通过 spring security 标记进行配置,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<security:authentication-manager alias="apiAuthenticationManager">
<security:authentication-provider ref="apiAuthenticationProvider" />
</security:authentication-manager>
<security:authentication-provider >
<security:user-service>
<security:user name="apiadmin" password="password" authorities="ROLE_API_ADMIN" />
<security:user name="apiuser" password="otherpassword" authorities="ROLE_API_USER" />
</security:user-service>
</security:authentication-provider>
...
Run Code Online (Sandbox Code Playgroud)
我无法内联身份验证提供程序,因为我希望它可以被子 bean 配置覆盖。
我的问题是我无法在 security:authentication-provider 元素上定义别名/id 以在身份验证管理器中引用它。有一个简单的解决方法吗?
解决方案:
我终于想出了如何使用命名空间方式来做到这一点,而无需深入研究普通的 bean 配置:)
<security:user-service id="apiUserDetailsService">
<security:user name="apiadmin" password="password" authorities="ROLE_API_ADMIN" />
<security:user name="apiuser" password="otherpassword" authorities="ROLE_API_USER" />
</security:user-service>
<security:authentication-manager alias="apiAuthenticationManager">
<security:authentication-provider user-service-ref="apiUserDetailsService"/>
</security:authentication-manager>
Run Code Online (Sandbox Code Playgroud) 我在 redux-observable 中有以下场景。我有一个组件可以检测要使用的后端,并应该设置 api 客户端使用的后端 URL。客户端和 URL 都保存在全局状态对象中。
执行顺序应该是: 1. 检查后端 2. 出错时替换保持在状态中的后端 URL 3. 触发 3 个动作以使用新的后端状态 URL 加载资源
到目前为止,我在第 1 步中所做的是从我的史诗中访问 state$ 对象并修改支持的 URL。这似乎只工作了一半。状态由 3 中触发的操作更新。仍然看到旧状态并使用错误的后端。
如果您依赖于执行顺序,那么在操作之间更新状态的标准方法是什么?
我的 API-Epic 看起来像这样:
export const authenticate = (action$, state$) => action$.pipe(
ofType(actions.API_AUTHENTICATE),
mergeMap(action =>
from(state$.value.apiState.apiClient.authenticate(state$.value.apiState.bearer)).pipe(
map(bearer => apiActions.authenticatedSuccess(bearer))
)
)
)
export const authenticatedSuccess = (action$, state$) => action$.pipe(
ofType(actions.API_AUTHENTICATED_SUCCESS),
concatMap(action => concat(
of(resourceActions.doLoadAResource()),
of(resourceActions.doLoadOtherResource()),
of(resourceActions.doLoadSomethingElse()))
)
)
Run Code Online (Sandbox Code Playgroud) 我试图通过此查询查询给定节点类型的子树:
SELECT * FROM [my:Type] AS my WHERE PATH(my) LIKE '/content/subtree/%'
Run Code Online (Sandbox Code Playgroud)
不知怎的,它没有给出任何结果 - 使用ISDESCENDANTNODE工作 - 但是只要我总共有> 5k个元素,查询性能就很糟糕 - 无论是在我的子树内部还是外部.
我有一个场景,客户端通过 STOMP 将消息发布到 RabbitMQ/queue或/topic目标。
另一方面,我有一个通过 AMQP 连接到 RabbitMQ 的服务器进程。是否可以从 AMQP 访问“STOMP 通道”,或者它们是否被隔离到自己的命名空间中?
看起来 AMQP 通道可以通过 STOMP 访问,/amq/queue/但我没有找到另一个方向的案例。
java ×2
amqp ×1
android ×1
dependencies ×1
gradle ×1
ide ×1
iphone ×1
jackrabbit ×1
javascript ×1
jcr ×1
jcr-sql2 ×1
rabbitmq ×1
react-redux ×1
reactjs ×1
rxjs ×1
spring ×1
stomp ×1