如何将2013-06-24转换为2013年6月24日?我使用以下代码.
date1="2013-06-24";
SimpleDateFormat d= new SimpleDateFormat("dd MMM yyyy");
try{
date2 = d.parse(date1);
}catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
但我收到此错误"java.text.ParseException:Unparseable date:"2013-06-24"(在偏移4处)"
我正在使用Espresso 2.2为View pager编写自动化测试,我需要在其中测试滑动功能.
我写了下面的代码:
@LargeTest
public class FirstActivityTest {
@Rule
public ActivityTestRule<FirstActivity> firstActivityTestRule =
new ActivityTestRule<>( FirstActivity.class);
@Test
public void testViewPagerSwipeFunctionality() throws InterruptedException{
onView(withId(R.id.tv_commu)).check(matches(withText(R.string.first_screen_text)));
onView(withId(R.id.tv_skip)).check(matches(withText(R.string.skip))) ;
onView(withId(R.id.radio_button_first)).check(matches(isChecked()));
onView(withId(R.id.view_pager)).perform(swipLeft());
onView(withId(R.id.radio_button_second))
.check(matches(isChecked()));
onView(withId(R.id.tv_comp)).check(matches(withText(R.string.second_screen_text)));
onView(withId(R.id.tv_skip)).check(matches(withText(R.string.skip))) ;
onView(withId(R.id.view_pager)).perform(swipeLeft());
onView(withId(R.id.radio_button_third))
.check(matches(isChecked()));
onView(withId(R.id.tv_skip)).check(matches(withText(R.string.skip))) ;
onView(withId(R.id.tv_person)).check(matches(withText(R.string.third_screen_text)));}}
Run Code Online (Sandbox Code Playgroud)
但是swipeLeft()方法没有得到解决.请告诉我我在哪里做错了?我们将非常感谢您的帮助.
我正在尝试从 Jenkins 声明式管道执行curl post 命令,但是,它抛出语法错误 - Expecting '}' find ':'
管道脚本如下:
pipeline {
agent { label ' Linux01'}
stages {
stage('Hello') {
steps {
sh 'curl -u username:password -X POST -d '{"body":"Jenkinspipleinecomment"}' -H "Content-Type:application/json" http://localhost:8080/rest/api/2/issue/someissue/comment'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
请帮忙。
我正在2.3.3版本中构建一个Android应用程序.这会在较低版本和较高版本中运行吗?我需要做些什么来实现这一目标?