コード例 #1
0
ファイル: elements.py プロジェクト: lanitgithub/jmeter_api
 def __init__(
         self,
         *,
         num_threads: int = 100,
         initial_delay: int = 0,
         start_users_count: int = 10,
         start_users_count_burst: int = 0,
         start_users_period: int = 30,
         stop_users_count: int = 5,
         stop_users_period: int = 1,
         hold: int = 60,
         ramp_up: int = 5,
         on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE,
         name: str = 'jp@gc - Stepping Thread Group (deprecated)',
         comments: str = '',
         is_enabled: bool = True):
     self.num_threads = num_threads
     self.initial_delay = initial_delay
     self.start_users_count = start_users_count
     self.start_users_count_burst = start_users_count_burst
     self.start_users_period = start_users_period
     self.stop_users_count = stop_users_count
     self.stop_users_period = stop_users_period
     self.hold = hold
     self.ramp_up = ramp_up
     BasicThreadGroup.__init__(self,
                               on_sample_error=on_sample_error,
                               name=name,
                               comments=comments,
                               is_enabled=is_enabled)
コード例 #2
0
ファイル: elements.py プロジェクト: lanitgithub/jmeter_api
 def __init__(
         self,
         *,
         schedule: List[dict] = [],
         on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE,
         name: str = 'jp@gc - Ultimate Thread Group',
         comments: str = '',
         is_enabled: bool = True):
     self.schedule = schedule
     BasicThreadGroup.__init__(self,
                               on_sample_error=on_sample_error,
                               name=name,
                               comments=comments,
                               is_enabled=is_enabled)
コード例 #3
0
 def __init__(self,
              log_filename: str = None,
              unit:  Unit = Unit.MINUTE,
              on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE,
              name: str = 'BasicBzmThreadGroup',
              comments: str = '',
              is_enabled: bool = True):
     self.log_filename = log_filename
     self.unit = unit
     BasicThreadGroup.__init__(self,
                     name=name,
                     comments=comments,
                     is_enabled=is_enabled,
                     on_sample_error=on_sample_error)
コード例 #4
0
 def __init__(self, *,
              continue_forever: bool,
              loops: int = 1,
              is_sheduler_enable: bool = False,
              sheduler_duration: int = 0,
              sheduler_delay: int = 0,
              name: str = 'BasicThreadGroup',
              comments: str = '',
              is_enabled: bool = True,
              num_threads: int = 1,
              ramp_time: int = 0,
              on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE,):
     self.continue_forever = continue_forever
     self.loops = loops
     self.is_sheduler_enable = is_sheduler_enable
     self.sheduler_duration = sheduler_duration
     self.sheduler_delay = sheduler_delay
     IncludesElements.__init__(self)
     BasicThreadGroup.__init__(self,
                               name=name,
                               comments=comments,
                               is_enabled=is_enabled,
                               num_threads=num_threads,
                               ramp_time=ramp_time)
コード例 #5
0
 def test_check(self):
     with pytest.raises(TypeError, match=r".*must be ThreadGroupAction*"):
         BasicThreadGroup(on_sample_error='stopthread')
コード例 #6
0
 def test_null_check(self):
     with pytest.raises(ValueError, match=r".*must be more than 0*"):
         BasicThreadGroup(num_threads=0)
コード例 #7
0
 def test_positive(self):
     btg = BasicThreadGroup(on_sample_error=ThreadGroupAction.CONTINUE)
     assert btg.on_sample_error is ThreadGroupAction.CONTINUE
コード例 #8
0
 def test_positive3(self):
     TestPlan().append(BasicThreadGroup())
コード例 #9
0
 def test_positive1(self):
     BasicThreadGroup().append(BasicPreProcessor())
コード例 #10
0
 def test_positive(self):
     btg = BasicThreadGroup(num_threads=10)
     assert btg.num_threads == 10
コード例 #11
0
 def test_negative2(self):
     with pytest.raises(TypeError):
         BasicController().append(BasicThreadGroup())
コード例 #12
0
 def test_positive7(self):
     BasicThreadGroup().append(BasicListener())
コード例 #13
0
 def test_positive8(self):
     BasicThreadGroup().append(BasicTimer())
コード例 #14
0
 def test_positive5(self):
     BasicThreadGroup().append(BasicSampler())
コード例 #15
0
 def test_positive6(self):
     BasicThreadGroup().append(BasicAssertion())
コード例 #16
0
 def test_positive4(self):
     BasicThreadGroup().append(BasicConfig())
コード例 #17
0
 def test_positive3(self):
     BasicThreadGroup().append(BasicController())
コード例 #18
0
 def test_positive2(self):
     BasicThreadGroup().append(BasicPostProcessor())
コード例 #19
0
 def test_positive(self):
     btg = BasicThreadGroup(ramp_time=25)
     assert btg.ramp_time == 25
コード例 #20
0
 def test_positive9(self):
     BasicThreadGroup().append(BasicTestFragment())
コード例 #21
0
 def test_check2(self):
     with pytest.raises(TypeError, match=r".*must be int*"):
         BasicThreadGroup(ramp_time='random chars')
コード例 #22
0
def test_basic_thread_group_parameter_num_threads_null_check():
    with pytest.raises(ValueError, match=r".*must be more than 0*"):
        BasicThreadGroup(num_threads=0)
コード例 #23
0
def test_basic_thread_group_parameter_num_threads_type_check():
    with pytest.raises(TypeError, match=r".*must be int.*"):
        BasicThreadGroup(num_threads='qweasd')
コード例 #24
0
 def test_check(self):
     with pytest.raises(TypeError, match=r".*must be int.*"):
         BasicThreadGroup(num_threads='qweasd')
コード例 #25
0
 def test_negative2(self):
     with pytest.raises(TypeError):
         BasicTestFragment().append(BasicThreadGroup())
コード例 #26
0
 def test_less_more_check(self):
     with pytest.raises(ValueError, match=r".*less than -1*"):
         BasicThreadGroup(num_threads=-5)
コード例 #27
0
def test_basic_thread_group_parameter_num_threads_less_mone_check():
    with pytest.raises(ValueError, match=r".*less than -1*"):
        BasicThreadGroup(num_threads=-5)
コード例 #28
0
 def test_negative2(self):
     with pytest.raises(TypeError):
         BasicThreadGroup().append(NonTestElements())