src_fm_fc_ms_ff
stringlengths 43
86.8k
| target
stringlengths 20
276k
|
---|---|
TopOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow) { RectF circleRectangle = layout.calcCircleRectF(); actionDescription.setX(circleRectangle.centerX() - (actionDescription.getWidth() / 2)); actionDescription.setY(circleRectangle.top - actionArrow.getHeight() - actionDescription.getHeight()); actionArrow.setRotation(90); actionArrow.setX(circleRectangle.centerX() - (actionArrow.getWidth() / 2)); actionArrow.setY(circleRectangle.top - actionArrow.getHeight()); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void renderTest() { View actionDescription = Mockito.mock(View.class); View actionArrow = Mockito.mock(View.class); Mockito.when(actionArrow.getWidth()).thenReturn(10); Mockito.when(actionDescription.getWidth()).thenReturn(20); Mockito.when(actionArrow.getHeight()).thenReturn(10); Mockito.when(actionDescription.getHeight()).thenReturn(20); CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); new TopOfCircleActionDescriptionRenderer().render(layoutMock, actionDescription, actionArrow); verify(actionDescription, times(1)).setX(52.5f); verify(actionDescription, times(1)).setY(20); verify(actionArrow, times(1)).setX(57.5f); verify(actionArrow, times(1)).setY(40); }
|
TopOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); RectF screenRectangle = layout.calcScreenRectF(); return circleRectangle.top > actionDescriptionRectangle.height() + actionArrowRectangle.height() && (actionDescriptionRectangle.width() / 2) < circleRectangle.centerX() && (actionDescriptionRectangle.width() / 2) < (screenRectangle.width() - circleRectangle.centerX()); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void isRenderingPossibleTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 50, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertTrue(new TopOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Test public void renderingNotPossibleNotEnoughLeftSpaceTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 126, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertFalse(new TopOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Test public void renderingNotPossibleNotEnoughTopSpaceTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 95)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 20, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 20, 5)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 15)); Assert.assertFalse(new TopOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
|
LeftOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow) { RectF circleRectangle = layout.calcCircleRectF(); int mWidth = actionDescription.getWidth() + actionArrow.getWidth(); actionDescription.setX((int) (circleRectangle.left - mWidth)); actionDescription.setY(circleRectangle.centerY() - (actionDescription.getHeight() / 2)); actionArrow.setX(circleRectangle.left - actionArrow.getWidth()); actionArrow.setY(circleRectangle.centerY() - (actionArrow.getHeight() / 2)); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void renderTest() { View actionDescription = Mockito.mock(View.class); View actionArrow = Mockito.mock(View.class); Mockito.when(actionArrow.getWidth()).thenReturn(30); Mockito.when(actionDescription.getWidth()).thenReturn(15); Mockito.when(actionArrow.getHeight()).thenReturn(10); Mockito.when(actionDescription.getHeight()).thenReturn(20); CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 95)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); new LeftOfCircleActionDescriptionRenderer().render(layoutMock, actionDescription, actionArrow); verify(actionDescription, times(1)).setX(5); verify(actionDescription, times(1)).setY(52.5f); verify(actionArrow, times(1)).setX(20); verify(actionArrow, times(1)).setY(57.5f); }
|
LeftOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < circleRectangle.left; } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void isRenderingPossibleTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 39, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertTrue(new LeftOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Test public void renderingNotPossibleNotEnoughLeftSpaceTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 40, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertFalse(new LeftOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
|
BelowCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow) { RectF circleRectangle = layout.calcCircleRectF(); actionDescription.setX(circleRectangle.centerX() - (actionDescription.getWidth() / 2)); actionDescription.setY(circleRectangle.bottom + actionArrow.getHeight()); actionArrow.setRotation(270); actionArrow.setX(circleRectangle.centerX() - (actionArrow.getWidth() / 2)); actionArrow.setY(circleRectangle.bottom); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void renderTest() { View actionDescription = Mockito.mock(View.class); View actionArrow = Mockito.mock(View.class); Mockito.when(actionArrow.getWidth()).thenReturn(10); Mockito.when(actionDescription.getWidth()).thenReturn(20); Mockito.when(actionArrow.getHeight()).thenReturn(10); Mockito.when(actionDescription.getHeight()).thenReturn(20); CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 95)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); new BelowCircleActionDescriptionRenderer().render(layoutMock, actionDescription, actionArrow); verify(actionDescription, times(1)).setX(52.5f); verify(actionDescription, times(1)).setY(85); verify(actionArrow, times(1)).setX(57.5f); verify(actionArrow, times(1)).setY(75); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withBackgroundColor(int color) { mCoachmarkView.setBackColor(color); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withBackgroundColorTest() throws Exception { mBuilderToTest.withBackgroundColor(0); verify(mCoachmarkViewMock, times(1)).setBackColor(0); }
|
BelowCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); RectF screenRectangle = layout.calcScreenRectF(); return (circleRectangle.bottom + actionDescriptionRectangle.height() + actionArrowRectangle.height()) < screenRectangle.height() && (actionDescriptionRectangle.width() / 2) < circleRectangle.centerX() && (actionDescriptionRectangle.width() / 2) < (screenRectangle.width() - circleRectangle.centerX()); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void isRenderingPossibleTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 50, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertTrue(new BelowCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Test public void renderingNotPossibleNotEnoughLeftSpaceTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 126, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertFalse(new BelowCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Test public void renderingNotPossibleNotEnoughBottomSpaceTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 95)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 20, 5)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 15)); Assert.assertFalse(new BelowCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
|
RightOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow) { RectF circleRectangle = layout.calcCircleRectF(); actionDescription.setX((int) (circleRectangle.right + actionArrow.getWidth())); actionDescription.setY(circleRectangle.centerY() - (actionDescription.getHeight() / 2)); actionArrow.setRotation(180); actionArrow.setX(circleRectangle.right); actionArrow.setY(circleRectangle.centerY() - (actionArrow.getHeight() / 2)); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void renderTest() { View actionDescription = Mockito.mock(View.class); View actionArrow = Mockito.mock(View.class); Mockito.when(actionArrow.getWidth()).thenReturn(30); Mockito.when(actionDescription.getWidth()).thenReturn(15); Mockito.when(actionArrow.getHeight()).thenReturn(10); Mockito.when(actionDescription.getHeight()).thenReturn(20); CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 95)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); new RightOfCircleActionDescriptionRenderer().render(layoutMock, actionDescription, actionArrow); verify(actionDescription, times(1)).setX(105.0f); verify(actionDescription, times(1)).setY(52.5f); verify(actionArrow, times(1)).setX(75); verify(actionArrow, times(1)).setY(57.5f); }
|
RightOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); RectF screenRectangle = layout.calcScreenRectF(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < (screenRectangle.width() - circleRectangle.right); } @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
|
@Test public void isRenderingPossibleTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 39, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertTrue(new RightOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Test public void renderingNotPossibleNotEnoughRightSpaceTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 95, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 10, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertFalse(new RightOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
|
OkAndCancelAtRightCornerButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { mView.setDismissListener(layout); if (mView.getParent() == null) { layout.addView(mView); } return mView; } private OkAndCancelAtRightCornerButtonRenderer(OkAndCancelAtRightCornerButtonRendererView view); @Override View render(final CoachmarkViewLayout layout); }
|
@Test public void renderTest() throws NoSuchFieldException, IllegalAccessException { OkAndCancelAtRightCornerButtonRenderer.Builder mBuilder = new OkAndCancelAtRightCornerButtonRenderer.Builder(Mockito.mock(Context.class)); OkAndCancelAtRightCornerButtonRenderer renderer = mBuilder.build(); OkAndCancelAtRightCornerButtonRendererView viewMock = Mockito.mock(OkAndCancelAtRightCornerButtonRendererView.class); ReflectionUtil.setField(OkAndCancelAtRightCornerButtonRenderer.class, renderer, "mView", viewMock); CoachmarkViewLayout layout = Mockito.mock(CoachmarkViewLayout.class); renderer.render(layout); verify(viewMock, times(1)).setDismissListener(layout); verify(layout, times(1)).addView(viewMock); }
|
OkBelowDescriptionButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { if (inflated == null) { LayoutInflater inflater = (LayoutInflater) layout.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflated = inflater.inflate(R.layout.ok_below_description_button_view, null); layout.addView(inflated); } TextView mTxtOkBtn = (TextView) inflated.findViewById(R.id.txt_ok_btn); LinearLayout mGroupOk = (LinearLayout) inflated.findViewById(R.id.group_ok); mTxtOkBtn.setText(mOkText); mGroupOk.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mListener == null || mListener.onClicked()) { layout.dismiss(); } } }); if (mBorder != 0) { GradientDrawable gradientDrawable = new GradientDrawable(); gradientDrawable.setStroke(mBorder, mColor != null ? mColor : ContextCompat.getColor(layout.getContext(),R.color.default_border_color)); mGroupOk.setBackground(gradientDrawable); } FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT); inflated.setLayoutParams(params); inflated.post(new Runnable() { @Override public void run() { RectF descriptionRectangle = layout.calcDescriptionRect(); inflated.setX(descriptionRectangle.centerX() - ((float) inflated.getWidth() / 2)); inflated.setY(descriptionRectangle.bottom + inflated.getContext().getResources().getDimension(R.dimen.button_padding)); inflated.setVisibility(View.VISIBLE); } }); return inflated; } private OkBelowDescriptionButtonRenderer(); @Override View render(final CoachmarkViewLayout layout); }
|
@Test public void renderTest() throws NoSuchFieldException, IllegalAccessException { View mMock = Mockito.mock(View.class); OkBelowDescriptionButtonRenderer.Builder mBuilder = new OkBelowDescriptionButtonRenderer.Builder(); mBuilder.withOkButton("ok", null); mBuilder.withBorder(2, 0); OkBelowDescriptionButtonRenderer renderer = mBuilder.build(); ReflectionUtil.setField(OkBelowDescriptionButtonRenderer.class, renderer, "inflated", mMock); TextView okBtn = Mockito.mock(TextView.class); when(mMock.getWidth()).thenReturn(5); when(mMock.findViewById(R.id.txt_ok_btn)).thenReturn(okBtn); LinearLayout groupOk = Mockito.mock(LinearLayout.class); when(mMock.findViewById(R.id.group_ok)).thenReturn(groupOk); Context mContextMock = Mockito.mock(Context.class); when(mMock.getContext()).thenReturn(mContextMock); Resources resMock = Mockito.mock(Resources.class); when(mContextMock.getResources()).thenReturn(resMock); when(resMock.getDimension(R.dimen.button_padding)).thenReturn(0f); CoachmarkViewLayout layout = Mockito.mock(CoachmarkViewLayout.class); when(layout.calcDescriptionRect()).thenReturn(new RectF(0, 0, 0, 0)); renderer.render(layout); verify(okBtn, times(1)).setText("ok"); verify(groupOk, times(1)).setOnClickListener(any(View.OnClickListener.class)); verify(groupOk, times(1)).setBackground(any(GradientDrawable.class)); verify(mMock, times(1)).setLayoutParams(any(FrameLayout.LayoutParams.class)); ArgumentCaptor<Runnable> fooCaptor = ArgumentCaptor.forClass(Runnable.class); verify(mMock).post(fooCaptor.capture()); fooCaptor.getValue().run(); verify(layout).calcDescriptionRect(); verify(mMock).setX(-2.5F); verify(mMock).setY(0); verify(mMock).setVisibility(View.VISIBLE); }
|
DismissOnTouchNoButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { if (inflated == null) { LayoutInflater inflater = (LayoutInflater) layout.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflated = inflater.inflate(R.layout.dismiss_no_button_view, null); layout.addView(inflated); } inflated.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mListener == null || mListener.onClicked()) { layout.dismiss(); } } }); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT); inflated.setLayoutParams(params); inflated.setVisibility(View.VISIBLE); return inflated; } private DismissOnTouchNoButtonRenderer(); @Override View render(final CoachmarkViewLayout layout); }
|
@Test public void renderTest() throws NoSuchFieldException, IllegalAccessException { View mMock = Mockito.mock(View.class); DismissOnTouchNoButtonRenderer renderer = new DismissOnTouchNoButtonRenderer.Builder().build(); ReflectionUtil.setField(DismissOnTouchNoButtonRenderer.class, renderer, "inflated", mMock); renderer.render(null); verify(mMock, times(1)).setOnClickListener(any(View.OnClickListener.class)); verify(mMock).setLayoutParams(any(FrameLayout.LayoutParams.class)); verify(mMock).setVisibility(View.VISIBLE); }
|
TopOrBottomDescriptionRenderer implements DescriptionRenderer { @Override public void render(CoachmarkViewLayout layout, View description) { RectF circle = layout.calcCircleRectF(); RectF screenRectangle = layout.calcScreenRectF(); if (circle.centerY() > screenRectangle.height() / 2) { description.setY(description.getContext().getResources().getDimension(R.dimen.description_padding)); } else { description.setY(screenRectangle.height() - description.getContext().getResources().getDimension(R.dimen.description_padding) - description.getHeight()); } } @Override void render(CoachmarkViewLayout layout, View description); }
|
@Test public void renderTestTopLayout(){ View descriptionViewMock = Mockito.mock(View.class); Context mContextMock = Mockito.mock(Context.class); when(descriptionViewMock.getContext()).thenReturn(mContextMock); Resources resMock = Mockito.mock(Resources.class); when(mContextMock.getResources()).thenReturn(resMock); when(resMock.getDimension(R.dimen.description_padding)).thenReturn(10f); CoachmarkViewLayout layout = Mockito.mock(CoachmarkViewLayout.class); RectF mCircleRectFMock = Mockito.mock(RectF.class); RectF mScreenRectFMock = Mockito.mock(RectF.class); when(layout.calcCircleRectF()).thenReturn(mCircleRectFMock); when(layout.calcScreenRectF()).thenReturn(mScreenRectFMock); when(mScreenRectFMock.height()).thenReturn(100f); when(mCircleRectFMock.centerY()).thenReturn(51f); new TopOrBottomDescriptionRenderer().render(layout, descriptionViewMock); verify(descriptionViewMock).setY(10f); }
@Test public void renderTestBottomLayout(){ View descriptionViewMock = Mockito.mock(View.class); Context mContextMock = Mockito.mock(Context.class); when(descriptionViewMock.getContext()).thenReturn(mContextMock); Resources resMock = Mockito.mock(Resources.class); when(mContextMock.getResources()).thenReturn(resMock); when(resMock.getDimension(R.dimen.description_padding)).thenReturn(10f); when(descriptionViewMock.getHeight()).thenReturn(5); CoachmarkViewLayout layout = Mockito.mock(CoachmarkViewLayout.class); RectF mCircleRectFMock = Mockito.mock(RectF.class); RectF mScreenRectFMock = Mockito.mock(RectF.class); when(layout.calcCircleRectF()).thenReturn(mCircleRectFMock); when(layout.calcScreenRectF()).thenReturn(mScreenRectFMock); when(mScreenRectFMock.height()).thenReturn(100f); when(mCircleRectFMock.centerY()).thenReturn(50f); new TopOrBottomDescriptionRenderer().render(layout, descriptionViewMock); verify(descriptionViewMock).setY(85f); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers) { mCoachmarkView.setActionDescriptionRenderer(renderers); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withActionDescriptionRenderers() throws Exception { mBuilderToTest.withActionDescriptionRenderers(null); verify(mCoachmarkViewMock, times(1)).setActionDescriptionRenderer(null); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public boolean isInEditMode() { return true; } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testIsInEditMode() { Assert.assertTrue(mCoachmarkView.isInEditMode()); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public void dismiss() { mWindowManager.removeView(CoachmarkView.this); if (mDismissListener != null) { mDismissListener.onDismiss(); } } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testIsCoachmarkDismissed() { mCoachmarkView.dismiss(); Assert.assertTrue(mCoachmarkView.getWindowToken() == null); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { public RectF calcCircleRectF() { if (mView == null) { return new RectF(); } float radius = mMarginAroundCircle + mView.getWidth() / 2; int[] xy = new int[2]; mView.getLocationOnScreen(xy); float centerX = xy[0] + mView.getWidth() / 2; float centerY = xy[1] + mView.getHeight() / 2; return new RectF(centerX - radius, centerY - radius, centerX + radius, centerY + radius); } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testCalcCircleRectF() { View mClickedViewMock = mock(View.class); when(mClickedViewMock.getHeight()).thenReturn(10); when(mClickedViewMock.getWidth()).thenReturn(30); doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); int[] mArg = (int[]) args[0]; mArg[0] = 3; mArg[1] = 2; return null; } }).when(mClickedViewMock).getLocationOnScreen(any(int[].class)); mCoachmarkView.setView(mClickedViewMock); mCoachmarkView.mMarginAroundCircle = 2; RectF mRectF = mCoachmarkView.calcCircleRectF(); Assert.assertEquals(34.0f, mRectF.width()); Assert.assertEquals(34.0f, mRectF.height()); Assert.assertEquals(1.0f, mRectF.left); Assert.assertEquals(-10.0f, mRectF.top); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { public RectF calcScreenRectF() { return new RectF(0, 0, getWidth(), getHeight()); } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testCalcScreenRectF() { mActivity.addContentView(mCoachmarkView, new LinearLayout.LayoutParams(200, 200)); RectF mRectF = mCoachmarkView.calcScreenRectF(); Assert.assertEquals(200.0f, mRectF.width()); Assert.assertEquals(200.0f, mRectF.height()); Assert.assertEquals(0.0f, mRectF.left); Assert.assertEquals(0.0f, mRectF.top); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @NonNull public RectF calcActionArrowRect() { return new RectF(mIvActionArrow.getX(), mIvActionArrow.getY(), mIvActionArrow.getX() + mIvActionArrow.getWidth(), mIvActionArrow.getY() + mIvActionArrow.getHeight()); } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testCalcActionArrowRectF() { ImageView mMock = mock(ImageView.class); when(mMock.getHeight()).thenReturn(20); when(mMock.getWidth()).thenReturn(30); when(mMock.getX()).thenReturn(2f); when(mMock.getY()).thenReturn(3f); mCoachmarkView.mIvActionArrow = mMock; RectF mRectF = mCoachmarkView.calcActionArrowRect(); Assert.assertEquals(30.0f, mRectF.width()); Assert.assertEquals(20.0f, mRectF.height()); Assert.assertEquals(2.0f, mRectF.left); Assert.assertEquals(3.0f, mRectF.top); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override protected void dispatchDraw(Canvas canvas) { if (mBitmap == null) { createWindowFrame(); } canvas.drawBitmap(mBitmap, null, calcScreenRectF(), null); super.dispatchDraw(canvas); if (!mIsInitialized) { mIsInitialized = true; if (mAnimationRenderer == null) { mAnimationRenderer = new NoAnimationRenderer(); } mAnimationRenderer.animate(CoachmarkView.this, mCircleView, CoachmarkView.this); } } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testDispatchDraw() throws NoSuchFieldException, IllegalAccessException { mActivity.addContentView(mCoachmarkView, new LinearLayout.LayoutParams(200, 200)); Canvas canvasMock = mock(Canvas.class); mCoachmarkView.setView(mock(View.class)); mCoachmarkView.mCircleView = mock(CircleView.class); mCoachmarkView.dispatchDraw(canvasMock); AnimationRenderer animRenderer = ReflectionUtil.getField(CoachmarkView.class, mCoachmarkView, "mAnimationRenderer"); Assert.assertTrue(animRenderer instanceof NoAnimationRenderer); Bitmap bitmap = ReflectionUtil.getField(CoachmarkView.class, mCoachmarkView, "mBitmap"); Assert.assertEquals(200, bitmap.getWidth()); Assert.assertEquals(200, bitmap.getHeight()); }
|
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public void onAnimationFinished() { if (mDescription != null) { mDescriptionRenderer.render(this, mDescription); mDescription.setVisibility(VISIBLE); } if (mActionDescription != null && mActionDescriptionRenderer != null) { renderActionDescription(); mActionDescription.setVisibility(VISIBLE); mIvActionArrow.setVisibility(VISIBLE); } if (mButtonRenderer != null) { mButtonRenderer.render(CoachmarkView.this); } } CoachmarkView(Context context); CoachmarkView(Context context, AttributeSet attrs); CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
|
@Test public void testOnAnimationFinished() throws NoSuchFieldException, IllegalAccessException { TextView desc = mock(TextView.class); TextView actionDesc = mock(TextView.class); mCoachmarkView.mIvActionArrow = mock(ImageView.class); DescriptionRenderer descRenderer = mock(DescriptionRenderer.class); ActionDescriptionRenderer actDescRenderer = mock(ActionDescriptionRenderer.class); when(actDescRenderer.isRenderingPossible(mCoachmarkView)).thenReturn(true); ButtonRenderer buttonRenderer = mock(ButtonRenderer.class); mCoachmarkView.setActionDescription(actionDesc); mCoachmarkView.setDescription(desc); mCoachmarkView.setButtonRenderer(buttonRenderer); mCoachmarkView.setActionDescriptionRenderer(actDescRenderer); mCoachmarkView.setDescriptionRenderer(descRenderer); mCoachmarkView.onAnimationFinished(); verify(descRenderer, times(1)).render(mCoachmarkView, desc); verify(actDescRenderer, times(1)).render(mCoachmarkView, actionDesc, mCoachmarkView.mIvActionArrow); verify(actDescRenderer, times(1)).isRenderingPossible(mCoachmarkView); verify(buttonRenderer, times(1)).render(mCoachmarkView); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer) { mCoachmarkView.setDescriptionRenderer(renderer); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withDescriptionRenderer() throws Exception { mBuilderToTest.withDescriptionRenderer(null); verify(mCoachmarkViewMock, times(1)).setDescriptionRenderer(null); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withActionDescription(View actionDescription) { mCoachmarkView.setActionDescription(actionDescription); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withActionDescriptionTest() throws Exception { mBuilderToTest.withActionDescription(null); verify(mCoachmarkViewMock, times(1)).setActionDescription(null); }
|
CoachmarkViewBuilder { public CoachmarkView buildAroundView(View view) { mCoachmarkView.setView(view); return mCoachmarkView; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void buildAroundViewTest() { View mMock = Mockito.mock(View.class); mBuilderToTest.buildAroundView(mMock); verify(mCoachmarkViewMock, times(1)).setView(mMock); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withDescription(View description) { mCoachmarkView.setDescription(description); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withDescriptionTest() throws Exception { mBuilderToTest.withDescription(null); verify(mCoachmarkViewMock, times(1)).setDescription(null); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withPaddingAroundCircle(int padding) { mCoachmarkView.setPaddingAroundCircle(padding); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withPaddingAroundCircle() throws Exception { mBuilderToTest.withPaddingAroundCircle(2); verify(mCoachmarkViewMock, times(1)).setPaddingAroundCircle(2); }
|
CoachmarkViewBuilder { public CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer){ mCoachmarkView.setAnimationRenderer(renderer); return this; } CoachmarkViewBuilder(Context context); CoachmarkViewBuilder withButtonRenderer(ButtonRenderer renderer); CoachmarkView buildAroundView(View view); CoachmarkView build(); CoachmarkViewBuilder withBackgroundColor(int color); CoachmarkViewBuilder withActionDescriptionRenderers(ActionDescriptionRenderer... renderers); CoachmarkViewBuilder withDescriptionRenderer(DescriptionRenderer renderer); CoachmarkViewBuilder withActionDescription(View actionDescription); CoachmarkViewBuilder withDescription(View description); CoachmarkViewBuilder withPaddingAroundCircle(int padding); CoachmarkViewBuilder withCircleColor(int color); CoachmarkViewBuilder withAnimationRenderer(AnimationRenderer renderer); }
|
@Test public void withAnimationRenderer() throws Exception { AnimationRenderer mMock = Mockito.mock(AnimationRenderer.class); mBuilderToTest.withAnimationRenderer(mMock); verify(mCoachmarkViewMock, times(1)).setAnimationRenderer(mMock); }
|
CircleView extends View { @Override protected void dispatchDraw(Canvas canvas) { Paint paint = new Paint(); paint.setColor(defaultColor); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT)); canvas.drawCircle(mCenterX, mCenterY, mRadius, paint); if(mTransparentRadius != 0){ Paint paintTransparent = new Paint(); paintTransparent.setColor(Color.YELLOW); paintTransparent.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT)); canvas.drawCircle(mCenterX, mCenterY, mTransparentRadius, paintTransparent); } super.dispatchDraw(canvas); } CircleView(Context context); CircleView(Context context, AttributeSet attrs); CircleView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) CircleView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); void setCenterX(float mCenterX); void setCenterY(float mCenterY); void setRadius(float radius); void setColor(int color); void setTransparentRadius(float radius); }
|
@Test public void testDispatchDraw() { ActivityController<Activity> activityController = Robolectric.buildActivity(Activity.class).create().start().resume() .visible(); Activity activity = activityController.get(); CircleView mView = new CircleView(activity); mView.setCenterY(2); mView.setCenterX(3); mView.setRadius(22); Canvas canvasMock = Mockito.mock(Canvas.class); mView.dispatchDraw(canvasMock); verify(canvasMock).drawCircle(Matchers.eq(3.0f), Matchers.eq(2.0f), Matchers.eq(22.0f), any(Paint.class)); }
|
PageDataExtractorOverTimeGui extends AbstractOverTimeVisualizer implements CMDLineArgumentsProcessor { @Override protected JSettingsPanel createSettingsPanel() { return new JSettingsPanel(this, JSettingsPanel.GRADIENT_OPTION | JSettingsPanel.MAXY_OPTION | JSettingsPanel.RELATIVE_TIME_OPTION | JSettingsPanel.AUTO_EXPAND_OPTION | JSettingsPanel.MARKERS_OPTION); } PageDataExtractorOverTimeGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override String getWikiPage(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void configure(TestElement te); @Override void add(SampleResult res); @Override void clearData(); void processCMDOption(String nextArg, ListIterator args); static final String[] columnIdentifiers; static final Class[] columnClasses; }
|
@Test public void testCreateSettingsPanel() { System.out.println("createSettingsPanel"); PageDataExtractorOverTimeGui instance = new PageDataExtractorOverTimeGui(); JSettingsPanel result = instance.createSettingsPanel(); assertNotNull(result); }
|
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
NoThreadClone, TestStateListener { @Override public synchronized void sampleOccurred(SampleEvent se) { long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); } @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
|
@Test public void testSampleOccurred() throws InterruptedException { System.out.println("sampleOccurred"); SampleResult res = new SampleResult(); res.setResponseCode("200"); SampleEvent se = new SampleEvent(res, "testTG"); ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.testStarted(); instance.sampleOccurred(se); instance.sampleOccurred(se); Thread.sleep(1020); instance.sampleOccurred(se); instance.sampleOccurred(se); Thread.sleep(1020); instance.sampleOccurred(se); instance.sampleOccurred(se); }
|
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
NoThreadClone, TestStateListener { @Override public void sampleStarted(SampleEvent se) { } @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
|
@Test public void testSampleStarted() { System.out.println("sampleStarted"); SampleEvent se = null; ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.sampleStarted(se); }
|
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
NoThreadClone, TestStateListener { @Override public void sampleStopped(SampleEvent se) { } @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
|
@Test public void testSampleStopped() { System.out.println("sampleStopped"); SampleEvent se = null; ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.sampleStopped(se); }
|
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
NoThreadClone, TestStateListener { @Override public void testStarted() { if (JMeter.isNonGUI()) { out = System.out; } else { out = new JMeterLoggerOutputStream(log); } cur = 0; } @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
|
@Test public void testTestStarted_0args() { System.out.println("testStarted"); ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.testStarted(); }
@Test public void testTestStarted_String() { System.out.println("testStarted"); String string = ""; ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.testStarted(string); }
|
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
NoThreadClone, TestStateListener { @Override public void testEnded() { } @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
|
@Test public void testTestEnded_0args() { System.out.println("testEnded"); ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.testEnded(); }
@Test public void testTestEnded_String() { System.out.println("testEnded"); String string = ""; ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.testEnded(string); }
|
ConsoleStatusLoggerGui extends AbstractListenerGui { @Override public String getStaticLabel() { return JMeterPluginsUtils.prefixLabel("Console Status Logger"); } ConsoleStatusLoggerGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); static final String WIKIPAGE; }
|
@Test public void testGetStaticLabel() { System.out.println("getStaticLabel"); ConsoleStatusLoggerGui instance = new ConsoleStatusLoggerGui(); String result = instance.getStaticLabel(); assertTrue(result.length() > 0); }
|
ConsoleStatusLoggerGui extends AbstractListenerGui { @Override public String getLabelResource() { return getClass().getCanonicalName(); } ConsoleStatusLoggerGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); static final String WIKIPAGE; }
|
@Test public void testGetLabelResource() { System.out.println("getLabelResource"); ConsoleStatusLoggerGui instance = new ConsoleStatusLoggerGui(); String result = instance.getLabelResource(); assertTrue(result.length() > 0); }
|
ConsoleStatusLoggerGui extends AbstractListenerGui { @Override public TestElement createTestElement() { TestElement te = new ConsoleStatusLogger(); modifyTestElement(te); te.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE)); return te; } ConsoleStatusLoggerGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); static final String WIKIPAGE; }
|
@Test public void testCreateTestElement() { System.out.println("createTestElement"); ConsoleStatusLoggerGui instance = new ConsoleStatusLoggerGui(); TestElement result = instance.createTestElement(); assertTrue(result instanceof ConsoleStatusLogger); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { @Override public void configure(TestElement el) { super.configure(el); setFile(el.getPropertyAsString(CorrectedResultCollector.FILENAME)); JMeterProperty fileValues = el.getProperty(DATA_PROPERTY); if (!(fileValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) fileValues; tableModel.removeTableModelListener(this); JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel, columnClasses); tableModel.addTableModelListener(this); updateUI(); } else { log.warn("Received null property instead of collection"); } checkDeleteButtonStatus(); checkMergeButtonStatus(); startTimeRef = 0; } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testConfigure() { System.out.println("configure"); TestElement el = new ResultCollector(); el.setProperty(new StringProperty(MergeResultsGui.FILENAME, "fusionRes.csv")); MergeResultsGui instance = new MergeResultsGui(); instance.modifyTestElement(el); instance.configure(el); }
@Test public void testConfigure_NullProperty() { System.out.println("configure"); TestElement el = new ResultCollector(); el.setProperty(new StringProperty(MergeResultsGui.FILENAME, "fusionRes.csv")); MergeResultsGui instance = new MergeResultsGui(); instance.configure(el); }
|
ConsoleStatusLoggerGui extends AbstractListenerGui { @Override public void modifyTestElement(TestElement te) { super.configureTestElement(te); } ConsoleStatusLoggerGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); static final String WIKIPAGE; }
|
@Test public void testModifyTestElement() { System.out.println("modifyTestElement"); TestElement te = new ConsoleStatusLogger(); ConsoleStatusLoggerGui instance = new ConsoleStatusLoggerGui(); instance.modifyTestElement(te); }
|
VariablesFromCSV extends Arguments { @Override public Map<String, String> getArgumentsAsMap() { Map<String, String> variables = new VariableFromCsvFileReader(getFileName()).getDataAsMap(getVariablePrefix(), getSeparator(), getSkipLines()); if (isStoreAsSystemProperty()) { for (Map.Entry<String, String> element : variables.entrySet()) { String variable = element.getKey(); if (System.getProperty(variable) == null) { System.setProperty(variable, element.getValue()); } } } return variables; } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testGetArgumentsAsMap() { System.out.println("getArgumentsAsMap"); VariablesFromCSV instance = new VariablesFromCSV(); instance.setFileName(fileName); instance.setSeparator(","); Map result = instance.getArgumentsAsMap(); assertEquals(result.size(), 2); }
|
VariablesFromCSV extends Arguments { public String getVariablePrefix() { return getPropertyAsString(VARIABLE_PREFIX); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testGetVariablePrefix() { System.out.println("getVariablePrefix"); VariablesFromCSV instance = new VariablesFromCSV(); String expResult = ""; String result = instance.getVariablePrefix(); assertEquals(expResult, result); }
|
VariablesFromCSV extends Arguments { public void setVariablePrefix(String prefix) { setProperty(VARIABLE_PREFIX, prefix); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testSetVariablePrefix() { System.out.println("setVariablePrefix"); String prefix = ""; VariablesFromCSV instance = new VariablesFromCSV(); instance.setVariablePrefix(prefix); }
|
VariablesFromCSV extends Arguments { public String getFileName() { return getPropertyAsString(FILENAME); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testGetFileName() { System.out.println("getFileName"); VariablesFromCSV instance = new VariablesFromCSV(); String expResult = ""; String result = instance.getFileName(); assertEquals(expResult, result); }
|
VariablesFromCSV extends Arguments { public void setFileName(String filename) { setProperty(FILENAME, filename); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testSetFileName() { System.out.println("setFileName"); String filename = ""; VariablesFromCSV instance = new VariablesFromCSV(); instance.setFileName(filename); }
|
VariablesFromCSV extends Arguments { public String getSeparator() { return getPropertyAsString(SEPARATOR); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testGetSeparator() { System.out.println("getSeparator"); VariablesFromCSV instance = new VariablesFromCSV(); String expResult = ""; String result = instance.getSeparator(); assertEquals(expResult, result); }
|
VariablesFromCSV extends Arguments { public void setSeparator(String separator) { setProperty(SEPARATOR, separator); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testSetSeparator() { System.out.println("setSeparator"); String separator = ""; VariablesFromCSV instance = new VariablesFromCSV(); instance.setSeparator(separator); }
|
VariablesFromCSV extends Arguments { public boolean isStoreAsSystemProperty() { return getPropertyAsBoolean(STORE_SYS_PROP); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testIsStoreAsSystemProperty() { System.out.println("isStoreAsSystemProperty"); VariablesFromCSV instance = new VariablesFromCSV(); boolean expResult = false; boolean result = instance.isStoreAsSystemProperty(); assertEquals(expResult, result); }
|
VariablesFromCSV extends Arguments { public void setStoreAsSystemProperty(boolean storeAsSysProp) { setProperty(STORE_SYS_PROP, storeAsSysProp); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void testSetStoreAsSystemProperty() { System.out.println("setStoreAsSystemProperty"); boolean storeAsSysProp = false; VariablesFromCSV instance = new VariablesFromCSV(); instance.setStoreAsSystemProperty(storeAsSysProp); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { public String getWikiPage() { return "MergeResults"; } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testGetWikiPage() { System.out.println("getWikiPage"); MergeResultsGui instance = new MergeResultsGui(); String expResult = "MergeResults"; String result = instance.getWikiPage(); assertEquals(expResult, result); }
|
VariablesFromCSV extends Arguments { public int getSkipLines() { return getPropertyAsInt(SKIP_LINES, SKIP_LINES_DEFAULT); } @Override Map<String, String> getArgumentsAsMap(); String getVariablePrefix(); void setVariablePrefix(String prefix); String getFileName(); void setFileName(String filename); String getSeparator(); void setSeparator(String separator); int getSkipLines(); void setSkipLines(int skipLines); boolean isStoreAsSystemProperty(); void setStoreAsSystemProperty(boolean storeAsSysProp); static final String VARIABLE_PREFIX; static final String FILENAME; static final String SEPARATOR; static final String SKIP_LINES; static final int SKIP_LINES_DEFAULT; static final String STORE_SYS_PROP; }
|
@Test public void skipLinesDefault() { VariablesFromCSV element = new VariablesFromCSV(); assertEquals("getSkipLines() did not return SKIP_LINES_DEFAULT", VariablesFromCSV.SKIP_LINES_DEFAULT, element.getSkipLines()); }
@Test public void skipLinesNonInteger() { VariablesFromCSV element = new VariablesFromCSV(); element.setProperty(VariablesFromCSV.SKIP_LINES, "a"); assertEquals("getSkipLines() did not return SKIP_LINES_DEFAULT", VariablesFromCSV.SKIP_LINES_DEFAULT, element.getSkipLines()); }
@Test public void skipLinesEmptyString() { VariablesFromCSV element = new VariablesFromCSV(); element.setProperty(VariablesFromCSV.SKIP_LINES, ""); assertEquals("getSkipLines() did not return SKIP_LINES_DEFAULT", VariablesFromCSV.SKIP_LINES_DEFAULT, element.getSkipLines()); }
|
VariablesFromCSVGui extends AbstractConfigGui { @Override public String getStaticLabel() { return JMeterPluginsUtils.prefixLabel("Variables From CSV File"); } VariablesFromCSVGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override void configure(TestElement element); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void clearGui(); JTextArea getCheckInfoTextArea(); static final String WIKIPAGE; }
|
@Test public void testGetStaticLabel() { System.out.println("getStaticLabel"); VariablesFromCSVGui instance = new VariablesFromCSVGui(); String result = instance.getStaticLabel(); assertTrue(result.length()>0); }
|
VariablesFromCSVGui extends AbstractConfigGui { @Override public String getLabelResource() { return getClass().getCanonicalName(); } VariablesFromCSVGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override void configure(TestElement element); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void clearGui(); JTextArea getCheckInfoTextArea(); static final String WIKIPAGE; }
|
@Test public void testGetLabelResource() { System.out.println("getLabelResource"); VariablesFromCSVGui instance = new VariablesFromCSVGui(); String result = instance.getLabelResource(); assertTrue(result.length()>0); }
|
VariablesFromCSVGui extends AbstractConfigGui { @Override public void configure(TestElement element) { super.configure(element); if (element instanceof VariablesFromCSV) { VariablesFromCSV varsCsv = (VariablesFromCSV)element; fileName.setText(varsCsv.getFileName()); variablePrefix.setText(varsCsv.getVariablePrefix()); separator.setText(varsCsv.getSeparator()); skipLines.setText(Integer.toString(varsCsv.getSkipLines())); storeSysProp.setSelected(varsCsv.isStoreAsSystemProperty()); } } VariablesFromCSVGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override void configure(TestElement element); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void clearGui(); JTextArea getCheckInfoTextArea(); static final String WIKIPAGE; }
|
@Test public void testConfigure() { System.out.println("configure"); TestElement element = new VariablesFromCSV(); VariablesFromCSVGui instance = new VariablesFromCSVGui(); instance.configure(element); }
|
VariablesFromCSVGui extends AbstractConfigGui { @Override public TestElement createTestElement() { VariablesFromCSV varsCsv = new VariablesFromCSV(); modifyTestElement(varsCsv); varsCsv.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE)); return varsCsv; } VariablesFromCSVGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override void configure(TestElement element); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void clearGui(); JTextArea getCheckInfoTextArea(); static final String WIKIPAGE; }
|
@Test public void testCreateTestElement() { System.out.println("createTestElement"); VariablesFromCSVGui instance = new VariablesFromCSVGui(); TestElement result = instance.createTestElement(); assertTrue(result instanceof VariablesFromCSV); }
|
VariablesFromCSVGui extends AbstractConfigGui { @Override public void modifyTestElement(TestElement te) { configureTestElement(te); if (te instanceof VariablesFromCSV) { VariablesFromCSV varsCsv = (VariablesFromCSV) te; varsCsv.setFileName(fileName.getText()); varsCsv.setVariablePrefix(variablePrefix.getText()); varsCsv.setSeparator(separator.getText()); varsCsv.setSkipLines(Integer.parseInt(skipLines.getText())); varsCsv.setStoreAsSystemProperty(storeSysProp.isSelected()); } } VariablesFromCSVGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override void configure(TestElement element); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void clearGui(); JTextArea getCheckInfoTextArea(); static final String WIKIPAGE; }
|
@Test public void testModifyTestElement() { System.out.println("modifyTestElement"); TestElement te = new VariablesFromCSV(); VariablesFromCSVGui instance = new VariablesFromCSVGui(); instance.modifyTestElement(te); }
|
VariablesFromCSVGui extends AbstractConfigGui { @Override public void clearGui() { super.clearGui(); initFields(); } VariablesFromCSVGui(); @Override String getStaticLabel(); @Override String getLabelResource(); @Override void configure(TestElement element); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement te); @Override void clearGui(); JTextArea getCheckInfoTextArea(); static final String WIKIPAGE; }
|
@Test public void testClearGui() { System.out.println("clearGui"); VariablesFromCSVGui instance = new VariablesFromCSVGui(); instance.clearGui(); }
|
VariableFromCsvFileReader { public Map<String, String> getDataAsMap(String prefix, String separator) { return getDataAsMap(prefix, separator, 0); } VariableFromCsvFileReader(String csvFileName); VariableFromCsvFileReader(BufferedReader input); Map<String, String> getDataAsMap(String prefix, String separator); Map<String, String> getDataAsMap(String prefix, String separator, int skipLines); }
|
@Test public void testGetDataAsMap() { System.out.println("getDataAsMap"); String prefix = ""; String separator = ","; VariableFromCsvFileReader instance = new VariableFromCsvFileReader(fileName); Map result = instance.getDataAsMap(prefix, separator); assertTrue(result.size() == 2); }
@Test public void testBufferedReaderInput() { String prefix = ""; String separator = ","; String csvData = "var0,val0\nvar1,val1"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect value for var0", "val0", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); }
@Test public void testExtraColumnsInput() { String prefix = ""; String separator = ","; String csvData = "var0,val0,a comment\nvar1,val1"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect value for var0", "val0", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); }
@Test public void testComments() { String prefix = ""; String separator = ","; String csvData = "var0,val0,a comment\n#var1,val1\nvar2,val2"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect value for var0", "val0", variables.get("var0")); assertNull("no value for var1", variables.get("var1")); assertEquals("incorrect value for var1", "val2", variables.get("var2")); }
@Test public void testBlankLineInput() { String prefix = ""; String separator = ","; String csvData = "var0,val0\n\nvar1,val1\n"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect number of variables parsed from input", 2, variables.size()); assertEquals("incorrect value for var0", "val0", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); }
@Test public void testSingleColumn() { String prefix = ""; String separator = ","; String csvData = "var0\n\nvar1,val1\n"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect value for var0", "", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); }
@Test public void testMutiLine() { String prefix = ""; String separator = ","; String csvData = "var0,\"line1\nline2\nline3\"\n\nvar1,val1\nvar2,\"lineA\nlineB\nlineC\nlineD\nlineE\""; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect value for var0", "line1\nline2\nline3", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); assertEquals("incorrect value for var2", "lineA\nlineB\nlineC\nlineD\nlineE", variables.get("var2")); }
@Test public void testVariablePrefix() { String prefix = "test"; String separator = ","; String csvData = "var0,val0,a comment\nvar1,val1"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator); assertEquals("incorrect value for testvar0", "val0", variables.get("testvar0")); assertEquals("incorrect value for testvar1", "val1", variables.get("testvar1")); assertNull("var0 should not be mapped", variables.get("var0")); assertNull("var1 should not be mapped", variables.get("var1")); }
@Test public void testSkipHeaderLine() { String prefix = ""; String separator = ","; String csvData = "name,value,description\nvar0,val0,a comment\nvar1,val1"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator, 1); assertNull("header line was interpreted as variable data", variables.get("name")); assertEquals("incorrect value for var0", "val0", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); }
@Test public void testSkipHeaderNegative() { String prefix = ""; String separator = ","; String csvData = "var0,val0,a comment\nvar1,val1"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator, -1); assertEquals("incorrect value for var0", "val0", variables.get("var0")); assertEquals("incorrect value for var1", "val1", variables.get("var1")); }
@Test(expected=IllegalArgumentException.class) public void testEmptySeparator() { String prefix = ""; String separator = ""; String csvData = "name,value,description\nvar0,val0,a comment\nvar1,val1"; BufferedReader input = new BufferedReader(new StringReader(csvData)); VariableFromCsvFileReader instance = new VariableFromCsvFileReader(input); Map variables = instance.getDataAsMap(prefix, separator, 1); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { public void checkDeleteButtonStatus() { deleteRowButton.setEnabled(tableModel != null && tableModel.getRowCount() > 0); } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testCheckDeleteButtonStatus() { System.out.println("checkDeleteButtonStatus"); MergeResultsGui instance = new MergeResultsGui(); instance.checkDeleteButtonStatus(); ActionEvent actionAdd = new ActionEvent(new JButton(), 1, "add"); instance.actionPerformed(actionAdd); instance.checkDeleteButtonStatus(); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { public void checkMergeButtonStatus() { mergeButton.setEnabled(tableModel != null && tableModel.getRowCount() > 0); } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testCheckMergeButtonStatus() { System.out.println("checkMergeButtonStatus"); MergeResultsGui instance = new MergeResultsGui(); instance.checkMergeButtonStatus(); ActionEvent actionAdd = new ActionEvent(new JButton(), 1, "add"); instance.actionPerformed(actionAdd); instance.checkMergeButtonStatus(); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { protected final void init() { JMeterPluginsUtils.addHelpLinkToPanel(this, WIKIPAGE); JPanel containerPanel = new VerticalPanel(); containerPanel.add(createParamsPanel(), BorderLayout.NORTH); containerPanel.add(GuiBuilderHelper.getComponentWithMargin(createChart(), 2, 2, 0, 2), BorderLayout.CENTER); add(containerPanel, BorderLayout.CENTER); createControllerPanel(); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testInit() { System.out.println("init"); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.init(); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public String getLabelResource() { return this.getClass().getSimpleName(); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testGetLabelResource() { System.out.println("getLabelResource"); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); String expResult = "UltimateThreadGroupGui"; String result = instance.getLabelResource(); assertEquals(expResult, result); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public String getStaticLabel() { return JMeterPluginsUtils.prefixLabel("Ultimate Thread Group"); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testGetStaticLabel() { System.out.println("getStaticLabel"); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); String result = instance.getStaticLabel(); assertTrue(result.length() > 0); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public TestElement createTestElement() { UltimateThreadGroup tg = new UltimateThreadGroup(); modifyTestElement(tg); tg.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE)); return tg; } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testCreateTestElement() { System.out.println("createTestElement"); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); TestElement result = instance.createTestElement(); assertTrue(result instanceof UltimateThreadGroup); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public void modifyTestElement(TestElement tg) { if (grid.isEditing()) { grid.getCellEditor().stopCellEditing(); } if (tg instanceof UltimateThreadGroup) { UltimateThreadGroup utg = (UltimateThreadGroup) tg; CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, UltimateThreadGroup.DATA_PROPERTY); utg.setData(rows); utg.setSamplerController((LoopController) loopPanel.createTestElement()); } super.configureTestElement(tg); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testModifyTestElement() { System.out.println("modifyTestElement"); UltimateThreadGroup tg = new UltimateThreadGroup(); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.tableModel = UltimateThreadGroupTest.getTestModel(); instance.modifyTestElement(tg); CollectionProperty data = (CollectionProperty) tg.getData(); assertEquals(3, data.size()); assertEquals("[[1, 2, 3, 4, 44], [5, 6, 7, 8, 88], [9, 10, 11, 12, 122]]", data.toString()); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public void configure(TestElement tg) { super.configure(tg); UltimateThreadGroup utg = (UltimateThreadGroup) tg; JMeterProperty threadValues = utg.getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; tableModel.removeTableModelListener(this); JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel); tableModel.addTableModelListener(this); updateUI(); } else { log.warn("Received null property instead of collection"); } TestElement te = (TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue(); if (te != null) { loopPanel.configure(te); } buttons.checkDeleteButtonStatus(); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testConfigure() { System.out.println("configure"); UltimateThreadGroup tg = new UltimateThreadGroup(); tg.setData(getTestData()); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.configure(tg); assertEquals(3, instance.tableModel.getRowCount()); assertEquals(3, instance.grid.getRowCount()); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public void clearGui() { super.clearGui(); tableModel.clearData(); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testClearGui() { System.out.println("clearGui"); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.clearGui(); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { public void tableChanged(TableModelEvent e) { updateUI(); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testTableChanged() { System.out.println("tableChanged"); TableModelEvent e = null; UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.tableChanged(e); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { public void editingStopped(ChangeEvent e) { updateUI(); } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testEditingStopped() { System.out.println("editingStopped"); ChangeEvent e = null; UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.editingStopped(e); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { public void editingCanceled(ChangeEvent e) { } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testEditingCanceled() { System.out.println("editingCanceled"); ChangeEvent e = null; UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.editingCanceled(e); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { public void editingCanceled(ChangeEvent e) { } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testEditingCanceled() { System.out.println("editingCanceled"); MergeResultsGui instance = new MergeResultsGui(); instance.editingCanceled(new ChangeEvent(instance)); }
|
UltimateThreadGroupGui extends AbstractThreadGroupGui implements TableModelListener,
CellEditorListener { @Override public void updateUI() { super.updateUI(); if (tableModel != null) { UltimateThreadGroup utgForPreview = new UltimateThreadGroup(); utgForPreview.setData(JMeterPluginsUtils.tableModelRowsToCollectionPropertyEval(tableModel, UltimateThreadGroup.DATA_PROPERTY)); updateChart(utgForPreview); } } UltimateThreadGroupGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override TestElement createTestElement(); @Override void modifyTestElement(TestElement tg); @Override void configure(TestElement tg); @Override void updateUI(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void clearGui(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class[] columnClasses; static final Integer[] defaultValues; }
|
@Test public void testUpdateUI() { System.out.println("updateUI"); UltimateThreadGroupGui instance = new UltimateThreadGroupGui(); instance.updateUI(); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { protected abstract void scheduleThread(JMeterThread thread, long now); AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testScheduleThread_JMeterThread_long() { System.out.println("scheduleThread"); JMeterThread thread = null; long now = 0L; AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.scheduleThread(thread, now); }
@Test public void testScheduleThread_JMeterThread() { System.out.println("scheduleThread"); JMeterThread thread = null; AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.scheduleThread(thread); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine) { running = true; int numThreads = getNumThreads(); log.info("Starting thread group number " + groupNum + " threads " + numThreads); long now = System.currentTimeMillis(); final JMeterContext context = JMeterContextService.getContext(); for (int i = 0; running && i < numThreads; i++) { JMeterThread jmThread = makeThread(groupNum, notifier, threadGroupTree, engine, i, context); scheduleThread(jmThread, now); Thread newThread = new Thread(jmThread, jmThread.getThreadName()); registerStartedThread(jmThread, newThread); newThread.start(); } log.info("Started thread group number " + groupNum); } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testStart() { System.out.println("start"); int groupCount = 0; ListenerNotifier notifier = null; ListedHashTree threadGroupTree = null; StandardJMeterEngine engine = null; AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.start(groupCount, notifier, threadGroupTree, engine); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public boolean stopThread(String threadName, boolean now) { for (Entry<JMeterThread, Thread> entry : allThreads.entrySet()) { JMeterThread thrd = entry.getKey(); if (thrd.getThreadName().equals(threadName)) { thrd.stop(); thrd.interrupt(); if (now) { Thread t = entry.getValue(); if (t != null) { t.interrupt(); } } return true; } } return false; } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testStopThread() { System.out.println("stopThread"); String threadName = ""; boolean now = false; AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); boolean expResult = false; boolean result = instance.stopThread(threadName, now); assertEquals(expResult, result); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public void threadFinished(JMeterThread thread) { log.debug("Ending thread " + thread.getThreadName()); allThreads.remove(thread); } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testThreadFinished() { System.out.println("threadFinished"); HashTree hashtree = new HashTree(); hashtree.add(new LoopController()); JMeterThread thread = new JMeterThread(hashtree, null, null); AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.threadFinished(thread); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public void tellThreadsToStop() { running = false; for (Entry<JMeterThread, Thread> entry : allThreads.entrySet()) { JMeterThread item = entry.getKey(); item.stop(); item.interrupt(); Thread t = entry.getValue(); if (t != null) { t.interrupt(); } } } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testTellThreadsToStop() { System.out.println("tellThreadsToStop"); AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.tellThreadsToStop(); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public void stop() { running = false; for (JMeterThread item : allThreads.keySet()) { item.stop(); } } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testStop() { System.out.println("stop"); AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.stop(); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public int numberOfActiveThreads() { return allThreads.size(); } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testNumberOfActiveThreads() { System.out.println("numberOfActiveThreads"); AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); int expResult = 0; int result = instance.numberOfActiveThreads(); assertEquals(expResult, result); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public boolean verifyThreadsStopped() { boolean stoppedAll = true; for (Thread t : allThreads.values()) { stoppedAll = stoppedAll && verifyThreadStopped(t); } return stoppedAll; } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testVerifyThreadsStopped() { System.out.println("verifyThreadsStopped"); AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); boolean expResult = true; boolean result = instance.verifyThreadsStopped(); assertEquals(expResult, result); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { @Override public void stateChanged(ChangeEvent e) { log.debug("getting new collector"); collector = (ResultCollector) createTestElement(); } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testStateChanged() { System.out.println("stateChanged"); MergeResultsGui instance = new MergeResultsGui(); instance.stateChanged(new ChangeEvent(instance)); }
|
AbstractSimpleThreadGroup extends AbstractThreadGroup { @Override public void waitThreadsStopped() { for (Thread t : allThreads.values()) { waitThreadStopped(t); } } AbstractSimpleThreadGroup(); void scheduleThread(JMeterThread thread); @Override void start(int groupNum, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine); @Override boolean stopThread(String threadName, boolean now); @Override void threadFinished(JMeterThread thread); @Override void tellThreadsToStop(); @Override void stop(); @Override int numberOfActiveThreads(); @Override boolean verifyThreadsStopped(); @Override void waitThreadsStopped(); static final String THREAD_GROUP_DISTRIBUTED_PREFIX_PROPERTY_NAME; }
|
@Test public void testWaitThreadsStopped() { System.out.println("waitThreadsStopped"); AbstractSimpleThreadGroup instance = new AbstractSimpleThreadGroupImpl(); instance.waitThreadsStopped(); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { @Override protected void scheduleThread(JMeterThread thread, long tgStartTime) { int inUserCount = getInUserCountAsInt(); int outUserCount = getOutUserCountAsInt(); if (inUserCount == 0) { inUserCount = getNumThreads(); } if (outUserCount == 0) { outUserCount = getNumThreads(); } int inUserCountBurst = Math.min(getInUserCountBurstAsInt(), getNumThreads()); if (inUserCountBurst <= 0) { inUserCountBurst = inUserCount; } int rampUpBucket = thread.getThreadNum() < inUserCountBurst ? 0 : 1 + (thread.getThreadNum() - inUserCountBurst) / inUserCount; int rampUpBucketThreadCount = thread.getThreadNum() < inUserCountBurst ? inUserCountBurst : inUserCount; long threadGroupDelay = 1000L * getThreadGroupDelayAsInt(); long ascentPoint = tgStartTime + threadGroupDelay; long inUserPeriod = 1000L * getInUserPeriodAsInt(); long additionalRampUp = 1000L * getRampUpAsInt() / rampUpBucketThreadCount; long flightTime = 1000L * getFlightTimeAsInt(); long outUserPeriod = 1000L * getOutUserPeriodAsInt(); long rampUpDuration = 1000L * getRampUpAsInt(); long iterationDuration = inUserPeriod + rampUpDuration; int iterationCountTotal = getNumThreads() < inUserCountBurst ? 1 : (int) Math.ceil((double) (getNumThreads() - inUserCountBurst) / inUserCount); int lastIterationUserCount = (getNumThreads() - inUserCountBurst) % inUserCount; if (lastIterationUserCount == 0) { lastIterationUserCount = inUserCount; } long descentPoint = ascentPoint + iterationCountTotal * iterationDuration + (1000L * getRampUpAsInt() / inUserCount) * lastIterationUserCount + flightTime; long rampUpBucketStartTime = ascentPoint + rampUpBucket * iterationDuration; int rampUpBucketThreadPosition = thread.getThreadNum() < inUserCountBurst ? thread.getThreadNum() : (thread.getThreadNum() - inUserCountBurst) % inUserCount; long startTime = rampUpBucketStartTime + rampUpBucketThreadPosition * additionalRampUp; long endTime = descentPoint + outUserPeriod * (int) Math.floor((double) thread.getThreadNum() / outUserCount); log.debug(String.format("threadNum=%d, rampUpBucket=%d, rampUpBucketThreadCount=%d, rampUpBucketStartTime=%d, rampUpBucketThreadPosition=%d, rampUpDuration=%d, iterationDuration=%d, iterationCountTotal=%d, ascentPoint=%d, descentPoint=%d, startTime=%d, endTime=%d", thread.getThreadNum(), rampUpBucket, rampUpBucketThreadCount, rampUpBucketStartTime, rampUpBucketThreadPosition, rampUpDuration, iterationDuration, iterationCountTotal, ascentPoint, descentPoint, startTime, endTime)); thread.setStartTime(startTime); thread.setEndTime(endTime); thread.setScheduled(true); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testScheduleThread() { System.out.println("scheduleThread"); HashTree hashtree = new HashTree(); hashtree.add(new LoopController()); JMeterThread thread = new JMeterThread(hashtree, null, null); SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setNumThreads(15); instance.setInUserCount("5"); instance.setInUserCountBurst("10"); instance.setInUserPeriod("30"); instance.setRampUp("10"); instance.setThreadGroupDelay("5"); instance.setFlightTime("60"); long s1 = -1, s2; for (int n = 0; n < 10; n++) { thread.setThreadNum(n); instance.scheduleThread(thread); s2 = thread.getStartTime(); if (s1 >= 0) { assertEquals(1000, s2 - s1); } s1 = s2; } thread.setThreadNum(10); instance.scheduleThread(thread); s2 = thread.getStartTime(); assertEquals(31000, s2 - s1); s1 = s2; for (int n = 11; n < 15; n++) { thread.setThreadNum(n); instance.scheduleThread(thread); s2 = thread.getStartTime(); if (s1 >= 0) { assertEquals(2000, s2 - s1); } s1 = s2; } }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getThreadGroupDelay() { return getPropertyAsString(THREAD_GROUP_DELAY); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetThreadGroupDelay() { System.out.println("getThreadGroupDelay"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getThreadGroupDelay(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setThreadGroupDelay(String delay) { setProperty(THREAD_GROUP_DELAY, delay); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetThreadGroupDelay() { System.out.println("setThreadGroupDelay"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setThreadGroupDelay(delay); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getInUserPeriod() { return getPropertyAsString(INC_USER_PERIOD); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetInUserPeriod() { System.out.println("getInUserPeriod"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getInUserPeriod(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setInUserPeriod(String value) { setProperty(INC_USER_PERIOD, value); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetInUserPeriod() { System.out.println("setInUserPeriod"); String value = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setInUserPeriod(value); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getInUserCount() { return getPropertyAsString(INC_USER_COUNT); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetInUserCount() { System.out.println("getInUserCount"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getInUserCount(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getInUserCountBurst() { return getPropertyAsString(INC_USER_COUNT_BURST); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetInUserCountBurst() { System.out.println("getInUserCountBurst"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getInUserCountBurst(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setInUserCount(String delay) { setProperty(INC_USER_COUNT, delay); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetInUserCount() { System.out.println("setInUserCount"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setInUserCount(delay); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setInUserCountBurst(String text) { setProperty(INC_USER_COUNT_BURST, text); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetInUserCountBurst() { System.out.println("setInUserCountBurst"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setInUserCountBurst(delay); }
|
MergeResultsGui extends AbstractGraphPanelVisualizer implements
TableModelListener, CellEditorListener, ChangeListener, ActionListener { @Override public void clearGui() { super.clearGui(); tableModel.clearData(); mergeAndWritePanel.clearGui(); } MergeResultsGui(); @Override String getLabelResource(); @Override String getStaticLabel(); @Override Collection<String> getMenuCategories(); void setFile(String filename); String getFile(); String getWikiPage(); JTable getGrid(); @Override void modifyTestElement(TestElement c); @Override void configure(TestElement el); @Override void updateUI(); @Override void add(SampleResult res); @Override void setUpFiltering(CorrectedResultCollector rc); void actionPerformed(ActionEvent action); void checkDeleteButtonStatus(); void checkMergeButtonStatus(); void tableChanged(TableModelEvent e); void editingStopped(ChangeEvent e); void editingCanceled(ChangeEvent e); @Override void stateChanged(ChangeEvent e); @Override Dimension getPreferredSize(); @Override void clearGui(); @Override GraphPanelChart getGraphPanelChart(); static final String WIKIPAGE; static final String[] columnIdentifiers; static final Class<?>[] columnClasses; static final Object[] defaultValues; static final String DEFAULT_FILENAME; static final String FILENAME; static final String DATA_PROPERTY; static final int INPUT_FILE_NAME; static final int PREFIX_LABEL; static final int OFFSET_START; static final int OFFSET_END; static final int INCLUDE_LABEL; static final int REGEX_INCLUDE; static final int EXCLUDE_LABEL; static final int REGEX_EXCLUDE; }
|
@Test public void testClearGui() { System.out.println("clearGui"); MergeResultsGui instance = new MergeResultsGui(); instance.clearGui(); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getFlightTime() { return getPropertyAsString(FLIGHT_TIME); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetFlightTime() { System.out.println("getFlightTime"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getFlightTime(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setFlightTime(String delay) { setProperty(FLIGHT_TIME, delay); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetFlightTime() { System.out.println("setFlightTime"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setFlightTime(delay); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getOutUserPeriod() { return getPropertyAsString(DEC_USER_PERIOD); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetOutUserPeriod() { System.out.println("getOutUserPeriod"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getOutUserPeriod(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setOutUserPeriod(String delay) { setProperty(DEC_USER_PERIOD, delay); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetOutUserPeriod() { System.out.println("setOutUserPeriod"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setOutUserPeriod(delay); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getOutUserCount() { return getPropertyAsString(DEC_USER_COUNT); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetOutUserCount() { System.out.println("getOutUserCount"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getOutUserCount(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setOutUserCount(String delay) { setProperty(DEC_USER_COUNT, delay); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetOutUserCount() { System.out.println("setOutUserCount"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setOutUserCount(delay); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public String getRampUp() { return getPropertyAsString(RAMPUP); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetRampUp() { System.out.println("getRampUp"); SteppingThreadGroup instance = new SteppingThreadGroup(); String expResult = ""; String result = instance.getRampUp(); assertEquals(expResult, result); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public void setRampUp(String delay) { setProperty(RAMPUP, delay); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testSetRampUp() { System.out.println("setRampUp"); String delay = ""; SteppingThreadGroup instance = new SteppingThreadGroup(); instance.setRampUp(delay); }
|
SteppingThreadGroup extends AbstractSimpleThreadGroup { public int getThreadGroupDelayAsInt() { return getPropertyAsInt(THREAD_GROUP_DELAY); } SteppingThreadGroup(); String getThreadGroupDelay(); void setThreadGroupDelay(String delay); String getInUserPeriod(); void setInUserPeriod(String value); String getInUserCount(); void setInUserCount(String delay); String getInUserCountBurst(); void setInUserCountBurst(String text); String getFlightTime(); void setFlightTime(String delay); String getOutUserPeriod(); void setOutUserPeriod(String delay); String getOutUserCount(); void setOutUserCount(String delay); String getRampUp(); void setRampUp(String delay); int getThreadGroupDelayAsInt(); int getInUserPeriodAsInt(); int getInUserCountAsInt(); int getInUserCountBurstAsInt(); int getRampUpAsInt(); int getFlightTimeAsInt(); int getOutUserPeriodAsInt(); int getOutUserCountAsInt(); void setNumThreads(String execute); String getNumThreadsAsString(); }
|
@Test public void testGetThreadGroupDelayAsInt() { System.out.println("getThreadGroupDelayAsInt"); SteppingThreadGroup instance = new SteppingThreadGroup(); int expResult = 0; int result = instance.getThreadGroupDelayAsInt(); assertEquals(expResult, result); }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.