• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java States类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jmock.States的典型用法代码示例。如果您正苦于以下问题:Java States类的具体用法?Java States怎么用?Java States使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



States类属于org.jmock包,在下文中一共展示了States类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: shouldAddMyselfAsLeaderOfMetaToRoot

import org.jmock.States; //导入依赖的package包/类
@Test
public void shouldAddMyselfAsLeaderOfMetaToRoot() throws Throwable {
  final States state = context.states("request-message").startsAs("not-run");

  context.checking(new Expectations() {{
    oneOf(moduleInformationProvider).getModule(ModuleType.ControlRpc);
    will(returnFutureWithValue(controlRpcModule));

    oneOf(moduleInformationProvider).getModule(ModuleType.Tablet);
    will(returnFutureWithValue(tabletModule));

    oneOf(tabletModule).getTablet(with(any(String.class)), with(any(ByteBuffer.class)));
    will(returnValue(rootTablet));

    oneOf(rootTablet).getLeader();
    will(returnValue(NODE_ID));

    oneOf(controlRpcModule).doMessage(with(any(Request.class)));
    then(state.is("done"));
  }});

  MetaTabletLeaderBehavior metaTabletLeaderBehavior =
      new MetaTabletLeaderBehavior(NODE_ID, moduleInformationProvider);
  metaTabletLeaderBehavior.start();
  sync.waitUntil(state.is("done"));
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:27,代码来源:MetaTabletLeaderBehaviorTest.java


示例2: queryWithMoreThanOneProperty

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithMoreThanOneProperty() throws Exception{
	queryMockClass.addProperty("name", String.class);
	queryMockClass.addProperty("lastName", String.class);
	queryMockClass.addProperty("age", int.class);
	queryMockClass.addProperty("addressCity", String.class);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("lastName", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.city", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:25,代码来源:QueryObjectMethodParserTest.java


示例3: queryWithPropertiesAndMethods

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithPropertiesAndMethods() throws Exception{
	queryMockClass.addMethod(String.class, "getName");
	queryMockClass.addMethod(String.class, "getLastName");
	queryMockClass.addProperty("age", int.class);
	queryMockClass.addProperty("addressCity", String.class);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("lastName", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.city", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:25,代码来源:QueryObjectMethodParserTest.java


示例4: queryWithComparisonTypesOnProperties

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithComparisonTypesOnProperties() throws Exception{
	queryMockClass.addProperty("nameContains", String.class);
	queryMockClass.addProperty("ageGreater", int.class);
	queryMockClass.addProperty("addressCityStarts", String.class);
	queryMockClass.addProperty("addressNumberLesserOrEquals", int.class);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.CONTAINS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.GREATER);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.city", ComparisonType.STARTS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.number", ComparisonType.LESSER_OR_EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:25,代码来源:QueryObjectMethodParserTest.java


示例5: queryWithComparisonTypesOnMethods

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithComparisonTypesOnMethods() throws Exception{
	queryMockClass.addMethod(String.class, "getNameContains");
	queryMockClass.addMethod(int.class, "getAgeGreater");
	queryMockClass.addMethod(String.class, "getAddressCityStarts");
	queryMockClass.addMethod(int.class, "getAddressNumberLesserOrEquals");
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.CONTAINS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.GREATER);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.city", ComparisonType.STARTS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.number", ComparisonType.LESSER_OR_EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:25,代码来源:QueryObjectMethodParserTest.java


示例6: queryWithComparisonTypesUsingAnnotations

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithComparisonTypesUsingAnnotations() throws Exception{
	queryMockClass.addProperty("name", String.class);
	queryMockClass.addAnnotation("name", Contains.class, Location.FIELD);
	queryMockClass.addProperty("addressNumber", int.class);
	queryMockClass.addAnnotation("addressNumber", Greater.class, Location.GETTER);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.CONTAINS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.number", ComparisonType.GREATER);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:23,代码来源:QueryObjectMethodParserTest.java


示例7: queryWithComparisonTypesUsingAnnotationsOnMethods

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithComparisonTypesUsingAnnotationsOnMethods() throws Exception{
	queryMockClass.addMethod(String.class, "getName");
	queryMockClass.addMethodAnnotation("getName", Contains.class);
	queryMockClass.addMethod(int.class, "getAddressNumber");
	queryMockClass.addMethodAnnotation("getAddressNumber", Greater.class);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.CONTAINS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("address.number", ComparisonType.GREATER);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:23,代码来源:QueryObjectMethodParserTest.java


示例8: queryWithNullOptions

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithNullOptions() throws Exception{
	queryMockClass.addProperty("name", String.class);
	queryMockClass.addAnnotation("name", IgnoreWhenNull.class, Location.FIELD);
	queryMockClass.addProperty("lastNameStarts", String.class);
	queryMockClass.addAnnotation("lastNameStarts", CompareToNull.class, Location.GETTER);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPerson", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.EQUALS, NullOption.IGNORE_WHEN_NULL);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("lastName", ComparisonType.STARTS, NullOption.COMPARE_TO_NULL);when(s.is("condicao"));then(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:23,代码来源:QueryObjectMethodParserTest.java


示例9: queryWithOrderBy

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithOrderBy() throws Exception{
	queryMockClass.addProperty("name", String.class);
	queryMockClass.addProperty("age", int.class);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPersonOrderByLastNameDesc", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitOrderBy("lastName", OrderingDirection.DESC);when(s.is("conector"));then(s.is("final"));
   	 	one(visitorMock).visitEnd(); when(s.is("final"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:22,代码来源:QueryObjectMethodParserTest.java


示例10: queryMethodsWithOrderBy

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryMethodsWithOrderBy() throws Exception{
	queryMockClass.addMethod(String.class, "getName");
	queryMockClass.addMethod(int.class, "age");
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPersonOrderByLastNameDesc", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitOrderBy("lastName", OrderingDirection.DESC);when(s.is("conector"));then(s.is("final"));
   	 	one(visitorMock).visitEnd(); when(s.is("final"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:22,代码来源:QueryObjectMethodParserTest.java


示例11: queryWithDomainTerm

import org.jmock.States; //导入依赖的package包/类
@Test
public void queryWithDomainTerm() throws Exception{
	Annotation an = domainTermWithOneCondition("underage","age", "18", ComparisonType.LESSER);
	mockClass.addAnnotation(an);
	queryMockClass.addProperty("name", String.class);
	queryMockClass.addProperty("lastNameStarts", String.class);
	queryClass = queryMockClass.createClass();
	Method m = createMethodWithAnnotationForTesting(Person.class, "getPersonUnderage", QueryObject.class, queryClass);
	QueryInfo qi = parser.parse(m); 
	final QueryVisitor visitorMock = context.mock(QueryVisitor.class);
    
    context.checking(new Expectations() {{
    	States s = context.states("QUERY").startsAs("inicio");
   	 	one(visitorMock).visitEntity("Person");when(s.is("inicio"));then(s.is("condicao"));
   	 	one(visitorMock).visitCondition("name", ComparisonType.EQUALS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("lastName", ComparisonType.STARTS);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitCondition("age", ComparisonType.LESSER, 18);when(s.is("condicao"));then(s.is("conector"));
   	 	one(visitorMock).visitEnd(); when(s.is("conector"));
   	 	allowing(visitorMock).visitConector("and");when(s.is("conector"));then(s.is("condicao"));
   	}});
    
    qi.visit(visitorMock);	
}
 
开发者ID:EsfingeFramework,项目名称:querybuilder,代码行数:24,代码来源:QueryObjectMethodParserTest.java


示例12: testErrorMessagesIncludeCurrentStates

import org.jmock.States; //导入依赖的package包/类
public void testErrorMessagesIncludeCurrentStates() {
    readiness.startsAs("ethelred");
    
    States fruitiness = context.states("fruitiness");
    fruitiness.startsAs("apple");
    
    context.checking(new Expectations() {{
        allowing (mock).method1(); when(readiness.is("ready"));
    }});
    
    try {
        mock.method1();
        fail("should have thrown ExpectationError");
    }
    catch (ExpectationError e) {
        String message = e.toString();
        
        AssertThat.stringIncludes("should describe readiness state", 
                                  "readiness is ethelred", message);
        AssertThat.stringIncludes("should describe fruitiness state", 
                                  "fruitiness is apple", message);
    }
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:24,代码来源:StatesAcceptanceTest.java


示例13: canWaitForAStateMachineToEnterAGivenState

import org.jmock.States; //导入依赖的package包/类
@Test(timeout=250)
public void canWaitForAStateMachineToEnterAGivenState() throws InterruptedException {
    final AtomicInteger counter = new AtomicInteger(blitzer.totalActionCount());
    
    final States threads = mockery.states("threads");
    
    mockery.checking(new Expectations() {{
        exactly(blitzer.totalActionCount()).of(mockObject).action();
            when(threads.isNot("finished"));
            
        oneOf(mockObject).finished();
            then(threads.is("finished"));
    }});
    
    blitzer.blitz(new Runnable() {
        public void run() {
            mockObject.action();
            if (counter.decrementAndGet() == 0) {
                mockObject.finished();
            }
        }
    });
    
    synchroniser.waitUntil(threads.is("finished"));
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:26,代码来源:SynchroniserTests.java


示例14: canWaitForAStateMachineToEnterAGivenStateWithinSomeTimeout

import org.jmock.States; //导入依赖的package包/类
@Test(timeout=250)
public void canWaitForAStateMachineToEnterAGivenStateWithinSomeTimeout() throws InterruptedException {
    final States threads = mockery.states("threads");
    
    mockery.checking(new Expectations() {{
        exactly(blitzer.totalActionCount()).of(mockObject).action();
            when(threads.isNot("finished"));
            
        oneOf(mockObject).finished();
            then(threads.is("finished"));
    }});
    
    blitzer.blitz(new Runnable() {
        AtomicInteger counter = new AtomicInteger(blitzer.totalActionCount());
        
        public void run() {
            mockObject.action();
            if (counter.decrementAndGet() == 0) {
                mockObject.finished();
            }
        }
    });
    
    synchroniser.waitUntil(threads.is("finished"), 100);
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:26,代码来源:SynchroniserTests.java


示例15: throwsExpectationErrorIfExpectationFailsWhileWaitingForStateMachine

import org.jmock.States; //导入依赖的package包/类
@Test
public void throwsExpectationErrorIfExpectationFailsWhileWaitingForStateMachine() throws InterruptedException {
    final States threads = mockery.states("threads");
    
    // This will cause an expectation error, and nothing will make
    // the "threads" state machine transition to "finished" 
    
    blitzer.blitz(new Runnable() {
        public void run() {
            mockObject.action();
        }
    });
    
    try {
        synchroniser.waitUntil(threads.is("finished"), 100);
        fail("should have thrown AssertionError");
    }
    catch (AssertionError e) {
        assertThat(e.getMessage(), containsString("action()"));
    }
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:22,代码来源:SynchroniserTests.java


示例16: allowSubmitOrExecuteOnce

import org.jmock.States; //导入依赖的package包/类
public static void allowSubmitOrExecuteOnce(Mockery context, ExecutorService executorService) {
  final States submitted = context.states("submitted").startsAs("no");

  context.checking(new Expectations() {{
    allowSubmitAndThen(context, executorService, submitted.is("yes"));
    doNowAllowSubmitOnce(context, executorService, submitted.is("yes"));
  }});
}
 
开发者ID:cloud-software-foundation,项目名称:c5-replicator,代码行数:9,代码来源:WrappingKeySerializingExecutorTest.java


示例17: shouldBeAbleToStartServer

import org.jmock.States; //导入依赖的package包/类
@Test
public void shouldBeAbleToStartServer() throws Throwable {
  final States searching = context.states("running");

  TableName clientTableName = TabletNameHelpers.getClientTableName("c5", name.getMethodName());
  org.apache.hadoop.hbase.TableName tableName = TabletNameHelpers.getHBaseTableName(clientTableName);

  HRegionInfo hRegionInfo = new HRegionInfo(tableName, new byte[]{}, new byte[]{});
  context.checking(new Expectations() {
    {
      allowing(c5Server).getNodeId();
      will(returnValue(1l));

      oneOf(controlModule).doMessage(with(any(Request.class)));
      then(searching.is("done")); //TODO make sure the message is correct

      allowing(tablet).getRegionInfo();
      will(returnValue(hRegionInfo));

      oneOf(tablet).getLeader();
      will(returnValue(1l));

      oneOf(tablet).getRegion();
      will(returnValue(region));

      oneOf(region).mutate(with(any(MutationProto.class)), with(any(Condition.class)));
      will(returnValue(true));
    }
  });
  NonBlockingHashMap<String, ConcurrentSkipListMap<byte[], Tablet>> tabletRegistryTables
      = tabletService.tabletRegistry.getTables();
  ConcurrentSkipListMap<byte[], Tablet> metaTablet = new ConcurrentSkipListMap<>(new C5Compare());
  metaTablet.put(new byte[]{0x00}, tablet);
  tabletRegistryTables.put("hbase:meta", metaTablet);
  tabletService.acceptCommand(TestHelpers.getCreateTabletSubCommand(tableName,
      new byte[][]{},
      Arrays.asList(c5Server)));
  sync.waitUntil(searching.is("done"));
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:40,代码来源:BasicTableCreationTest.java


示例18: autoInstantiate

import org.jmock.States; //导入依赖的package包/类
private void autoInstantiate(Object object, Field field) {
    final Class<?> type = field.getType();
    if (type == States.class) {
        autoInstantiateStates(field, object);
    }
    else if (type == Sequence.class) {
        autoInstantiateSequence(field, object);
    }
    else {
        throw new IllegalStateException("cannot auto-instantiate field of type " + type.getName());
    }
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:13,代码来源:Mockomatic.java


示例19: describeMismatchSafely

import org.jmock.States; //导入依赖的package包/类
@Override
protected void describeMismatchSafely(States stateMachine, Description mismatchDescription) {
    mismatchDescription.appendText("was ");
    if (!stateMachine.is(stateName).isActive()) {
        mismatchDescription.appendText("not ");
    }
    mismatchDescription.appendText(stateName);
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:9,代码来源:CurrentStateMatcher.java


示例20: failsTheTestIfStateMachineDoesNotEnterExpectedStateWithinTimeout

import org.jmock.States; //导入依赖的package包/类
@Test(timeout=250)
public void failsTheTestIfStateMachineDoesNotEnterExpectedStateWithinTimeout() throws InterruptedException {
    States threads = mockery.states("threads");
    
    try {
        synchroniser.waitUntil(threads.is("finished"), 100);
    }
    catch (AssertionError e) {
        return;
    }
    
    fail("should have thrown AssertionError");
}
 
开发者ID:Shared-Business-Service,项目名称:jMock-Demo,代码行数:14,代码来源:SynchroniserTests.java



注:本文中的org.jmock.States类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XpathException类代码示例发布时间:2022-05-22
下一篇:
Java SpanishAnalyzer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap