当前位置: 首页>>代码示例>>Java>>正文


Java PatternDataField类代码示例

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


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

示例1: testIsMember

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testIsMember() throws Exception {
	
	PatternDataField intField = new PatternDataField(INT, PatternUsage.GROUP);
	PatternDataField rangeField = new PatternDataField(RANGE, PatternUsage.GROUP);
	PatternDataField asteriskField = new PatternDataField(ASTERISK, PatternUsage.GROUP);
	PatternDataField xField = new PatternDataField(X, PatternUsage.GROUP);
	
	int member = Integer.parseInt(INT);
	int nonMember = HIGH + 100;
	
	// test with member
	Assert.assertTrue(intField.isMember(member));
	Assert.assertTrue(rangeField.isMember(member));
	Assert.assertTrue(asteriskField.isMember(member));
	Assert.assertTrue(xField.isMember(member));
	
	// test with non member
	Assert.assertFalse(intField.isMember(nonMember));
	Assert.assertFalse(rangeField.isMember(nonMember));
	Assert.assertTrue(asteriskField.isMember(nonMember));
	Assert.assertTrue(xField.isMember(nonMember));
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:24,代码来源:PatternDataFieldTest.java

示例2: testCreateTagDataFieldWithInvalidStringRepresentation_Range

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateTagDataFieldWithInvalidStringRepresentation_Range() throws Exception {
	
	try {
		new PatternDataField(RANGE, PatternUsage.TAG);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + RANGE + "'. Only 'int' is allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + RANGE + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例3: testCreateTagDataFieldWithInvalidStringRepresentation_Asterisk

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateTagDataFieldWithInvalidStringRepresentation_Asterisk() throws Exception {
	
	try {
		new PatternDataField(ASTERISK, PatternUsage.TAG);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + ASTERISK + "'. Only 'int' is allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + ASTERISK + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例4: testCreateTagDataFieldWithInvalidStringRepresentation_X

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateTagDataFieldWithInvalidStringRepresentation_X() throws Exception {
	
	try {
		new PatternDataField(X, PatternUsage.TAG);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + X + "'. Only 'int' is allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + X + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例5: testCreateTagDataFieldWithInvalidStringRepresentation_Abc

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateTagDataFieldWithInvalidStringRepresentation_Abc() throws Exception {
	
	try {
		new PatternDataField(ABC, PatternUsage.TAG);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + ABC + "'. Only 'int' is allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + ABC + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例6: testCreateFilterDataField

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateFilterDataField() throws Exception {
	
	new PatternDataField(INT, PatternUsage.FILTER);
	new PatternDataField(RANGE, PatternUsage.FILTER);
	new PatternDataField(ASTERISK, PatternUsage.FILTER);
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:9,代码来源:PatternDataFieldTest.java

示例7: testCreateFilterDataFieldWithInvalidStringRepresentation_X

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateFilterDataFieldWithInvalidStringRepresentation_X() throws Exception {
	
	try {
		new PatternDataField(X, PatternUsage.FILTER);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + X + "'. Only '*', '[lo-hi]' or 'int' are allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + X + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例8: testCreateFilterDataFieldWithInvalidStringRepresentation_Abc

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateFilterDataFieldWithInvalidStringRepresentation_Abc() throws Exception {
	
	try {
		new PatternDataField(ABC, PatternUsage.FILTER);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + ABC + "'. Only '*', '[lo-hi]' or 'int' are allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + ABC + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例9: testCreateGroupDataField

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateGroupDataField() throws Exception {
	
	new PatternDataField(INT, PatternUsage.GROUP);
	new PatternDataField(RANGE, PatternUsage.GROUP);
	new PatternDataField(ASTERISK, PatternUsage.GROUP);
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:9,代码来源:PatternDataFieldTest.java

示例10: testCreateGroupDataFieldWithInvalidStringRepresentation_Abc

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testCreateGroupDataFieldWithInvalidStringRepresentation_Abc() throws Exception {
	
	try {
		new PatternDataField(ABC, PatternUsage.GROUP);
	} catch(ECSpecValidationException e) {
		Assert.assertEquals("Invalid data field '" + ABC + "'. Only '*', 'X', '[lo-hi]' or 'int' are allowed.", e.getMessage());
		return;
	}
	
	Assert.fail("Should throw an ECSpecValidationException because the string representation of the data field contains a '" + ABC + "'.");
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例11: testTypes

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testTypes() throws Exception {

	PatternDataField intField = new PatternDataField(INT, PatternUsage.GROUP);
	PatternDataField rangeField = new PatternDataField(RANGE, PatternUsage.GROUP);
	PatternDataField asteriskField = new PatternDataField(ASTERISK, PatternUsage.GROUP);
	PatternDataField xField = new PatternDataField(X, PatternUsage.GROUP);
	
	Assert.assertTrue(intField.isInt());
	Assert.assertFalse(intField.isRange());
	Assert.assertFalse(intField.isAsterisk());
	Assert.assertFalse(intField.isX());
	
	Assert.assertFalse(rangeField.isInt());
	Assert.assertTrue(rangeField.isRange());
	Assert.assertFalse(rangeField.isAsterisk());
	Assert.assertFalse(rangeField.isX());
	
	Assert.assertFalse(asteriskField.isInt());
	Assert.assertFalse(asteriskField.isRange());
	Assert.assertTrue(asteriskField.isAsterisk());
	Assert.assertFalse(asteriskField.isX());
	
	Assert.assertFalse(xField.isInt());
	Assert.assertFalse(xField.isRange());
	Assert.assertFalse(xField.isAsterisk());
	Assert.assertTrue(xField.isX());
	
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:30,代码来源:PatternDataFieldTest.java

示例12: testToString

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
@Test
public void testToString() throws Exception {

	PatternDataField intField = new PatternDataField(INT, PatternUsage.GROUP);
	PatternDataField rangeField = new PatternDataField(RANGE, PatternUsage.GROUP);
	PatternDataField asteriskField = new PatternDataField(ASTERISK, PatternUsage.GROUP);
	PatternDataField xField = new PatternDataField(X, PatternUsage.GROUP);
	
	Assert.assertEquals(INT, intField.toString());
	Assert.assertEquals(RANGE, rangeField.toString());
	Assert.assertEquals(ASTERISK, asteriskField.toString());
	Assert.assertEquals(X, xField.toString());
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:PatternDataFieldTest.java

示例13: testGetValueWithNonIntDataField

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
/**
 * must throw an ECSpecValidationException because data field is not an of type int.
 * @throws ECSpecValidationException test expected.
 */
@Test(expected = ECSpecValidationException.class)
public void testGetValueWithNonIntDataField() throws ECSpecValidationException {	
	PatternDataField rangeField = new PatternDataField(RANGE, PatternUsage.GROUP);
	rangeField.getValue();		
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:10,代码来源:PatternDataFieldTest.java

示例14: testGetLowWithNonRangeDataField

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
/**
 * must throw an ECSpecValidationException because data field is not of type range.
 * @throws ECSpecValidationException test expected.
 */
@Test(expected = ECSpecValidationException.class)
public void testGetLowWithNonRangeDataField() throws Exception {
	PatternDataField intField = new PatternDataField(INT, PatternUsage.GROUP);
	intField.getLow();
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:10,代码来源:PatternDataFieldTest.java

示例15: testGetHighWithNonRangeDataField

import org.fosstrak.ale.server.PatternDataField; //导入依赖的package包/类
/**
 * must throw an ECSpecValidationException because data field is not of type range.
 * @throws ECSpecValidationException test expected.
 */
@Test(expected = ECSpecValidationException.class)
public void testGetHighWithNonRangeDataField() throws Exception {
	PatternDataField intField = new PatternDataField(INT, PatternUsage.GROUP);
	intField.getHigh();
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:10,代码来源:PatternDataFieldTest.java


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