當前位置: 首頁>>代碼示例>>Java>>正文


Java Arrays.asList方法代碼示例

本文整理匯總了Java中edu.emory.mathcs.backport.java.util.Arrays.asList方法的典型用法代碼示例。如果您正苦於以下問題:Java Arrays.asList方法的具體用法?Java Arrays.asList怎麽用?Java Arrays.asList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.emory.mathcs.backport.java.util.Arrays的用法示例。


在下文中一共展示了Arrays.asList方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testIntrospectPropertyForItemsConnectedTo

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test
public void testIntrospectPropertyForItemsConnectedTo()
        throws InvalidPropertyException, InvocationTargetException, IllegalAccessException {
    String logicalId = "/myitem/myid";
    MyItemType myItemType = new MyItemType();
    String logicalId1 = logicalId + "1";
    String logicalId2 = logicalId + "2";
    MyItem myItem1 = new MyItem(logicalId1, myItemType);
    MyItem myItem2 = new MyItem(logicalId2, myItemType);
    myItem1.addConnectedRelationships(myItem2, "");
    MyItem[] myItemArray = {myItem1, myItem2};
    List<Fibre> items = Arrays.asList(myItemArray);

    String propertyName = RelationshipUtil.getRelationshipNameBetweenItems(myItem1, myItem2, "");
    List<Object> properties = FibreIntrospectionUtils.introspectPropertyForFibres(propertyName, items, null);

    assertNotNull("Returned properties was null", properties);
    assertEquals("Returned properties incorrect size", 2, properties.size());
    for (int count = 0; count < properties.size(); count++) {
        assertNotNull("Returned property was null at " + count, properties.get(count));
    }
    assertEquals("First property incorrect", myItem2, properties.get(0));
    assertEquals("Second property incorrect", myItem1, properties.get(1));
}
 
開發者ID:HewlettPackard,項目名稱:loom,代碼行數:25,代碼來源:BaseModelTest.java

示例2: test_loadQueryMap_multiMcp

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test
public void test_loadQueryMap_multiMcp() {
    String response96Chars = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; // iterations through the map

    Interpreter interpreter = Mockito.mock(Interpreter.class);
    Mockito.when(interpreter.processActiveLoadsResponse(Mockito.anyString()))
            .thenReturn(new HashMap<Integer, Executor.LoadStatus>());

    Map<Integer, Map<Integer, Executor.LoadStatus>> map = new HashMap();
    List<Integer> controllers = Arrays.asList(new Integer[] {1, 2});

    Gateway gateway = getGatewayForSystem(1);
    Executor e = Mockito.spy(Executor.createForGateway(gateway));

    e.loadMapFromResponse(map, controllers, interpreter, response96Chars);

    assertNotNull(map.get(Integer.valueOf(1)));
    assertNotNull(map.get(Integer.valueOf(2)));

    assertNull(map.get(Integer.valueOf(Interpreter.SINGLE_MCP_SYSTEM)));
    assertNull(map.get(Integer.valueOf(3)));
}
 
開發者ID:sourceallies,項目名稱:zonebeacon,代碼行數:24,代碼來源:ExecutorTest.java

示例3: test_loadQueryMap_singleMcp

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test
public void test_loadQueryMap_singleMcp() {
    String response96Chars = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";

    Interpreter interpreter = Mockito.mock(Interpreter.class);
    Mockito.when(interpreter.processActiveLoadsResponse(Mockito.anyString()))
            .thenReturn(new HashMap<Integer, Executor.LoadStatus>());

    Map<Integer, Map<Integer, Executor.LoadStatus>> map = new HashMap();
    List<Integer> controllers = Arrays.asList(new Integer[] {Interpreter.SINGLE_MCP_SYSTEM});

    Gateway gateway = getGatewayForSystem(1);
    Executor e = Mockito.spy(Executor.createForGateway(gateway));

    e.loadMapFromResponse(map, controllers, interpreter, response96Chars);

    // map should hold value for the single mcp system, since that is the controller number we passed in
    assertNotNull(map.get(Integer.valueOf(Interpreter.SINGLE_MCP_SYSTEM)));

    assertNull(map.get(Integer.valueOf(1)));
    assertNull(map.get(Integer.valueOf(2)));
}
 
開發者ID:sourceallies,項目名稱:zonebeacon,代碼行數:23,代碼來源:ExecutorTest.java

示例4: removeTopic

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
private String removeTopic(String whitelist, String topicToRemove) {
	List<String> topicList = new ArrayList<String>();
	List<String> newTopicList = new ArrayList<String>();

	if (whitelist.contains(",")) {
		topicList = Arrays.asList(whitelist.split(","));

	}

	if (topicList.contains(topicToRemove)) {
		for (String topic : topicList) {
			if (!topic.equals(topicToRemove)) {
				newTopicList.add(topic);
			}
		}
	}

	String newWhitelist = StringUtils.join(newTopicList, ",");

	return newWhitelist;
}
 
開發者ID:att,項目名稱:dmaap-framework,代碼行數:22,代碼來源:MMRestService.java

示例5: getWhitelistByNamespace

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
private String getWhitelistByNamespace(String originalWhitelist, String namespace) {

		String whitelist = null;
		List<String> resultList = new ArrayList<String>();
		List<String> whitelistList = new ArrayList<String>();
		whitelistList = Arrays.asList(originalWhitelist.split(","));

		for (String topic : whitelistList) {
			if (StringUtils.isNotBlank(originalWhitelist) && getNamespace(topic).equals(namespace)) {
				resultList.add(topic);
			}
		}
		if (resultList.size() > 0) {
			whitelist = StringUtils.join(resultList, ",");
		}

		return whitelist;
	}
 
開發者ID:att,項目名稱:dmaap-framework,代碼行數:19,代碼來源:MMRestService.java

示例6: value

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
/**
 * @see {@link ResolvedRelativePath#ResolvedRelativePath(String, String)}
 */
public String value() throws Exception {

    String absolutePath = preprocessedPath(this.absPath);
    String relativePath = preprocessedPath(this.unresolvedRelativePath);

    // build absolute path representing the given relative path
    List<String> absoluteParts = new ArrayList<String>(Arrays.asList(absolutePath.split("/")));
    String[] relativeParts = relativePath.split("/");
    for (String relativePart : relativeParts) {
        if (relativePart.equals(".")) {
            // means current directory, do nothing
            continue;
        } else if (relativePart.equalsIgnoreCase("..")) {
            // mean move up a level
            absoluteParts.remove(absoluteParts.size() - 1);
        } else {
            absoluteParts.add(relativePart);
        }
    }
    return "/" + String.join("/", absoluteParts);
}
 
開發者ID:Zir0-93,項目名稱:clarpse,代碼行數:25,代碼來源:ResolvedRelativePath.java

示例7: test

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test
public void test() throws Exception {

    /*
        This selector aims at keeping amplified test that execute new lines in the source code.
     */

    Utils.reset();
    Utils.init("src/test/resources/test-projects/test-projects.properties");
    EntryPoint.verbose = true;

    final DSpot dspot = new DSpot(Utils.getInputConfiguration(),
            1,
            Arrays.asList(new Amplifier[]{new TestDataMutator(), new StatementAdd()}),
            new CloverCoverageSelector()
    );
    final CtType ctType = dspot.amplifyTest(Utils.findClass("example.TestSuiteExample"),
            Collections.singletonList(Utils.findMethod("example.TestSuiteExample", "test2"))
    );
    assertFalse(ctType.getMethodsByName("test2_literalMutationNumber9").isEmpty());
    EntryPoint.verbose = false;
}
 
開發者ID:STAMP-project,項目名稱:dspot,代碼行數:23,代碼來源:CloverCoverageSelectorTest.java

示例8: removeSelectedYear

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@SuppressWarnings({ "unchecked", "deprecation" })
private void removeSelectedYear() {

	if (!this.lstSelectedYears.isSelectionEmpty())
	{
		List<Integer> values = Arrays.asList(lstSelectedYears.getSelectedValues());
		
		for (Integer val : values)
		{
			availableYearsModel.addElement(val);
		}
		
		if (lstSelectedYears.getSelectedIndices().length > 0)
		{
			List selected = Arrays.asList(lstSelectedYears.getSelectedValues());
			for (Object item : selected)
			{
				this.selectedYearsModel.removeElement(item);
			}
		}
		
	}
}
 
開發者ID:petebrew,項目名稱:fhaes,代碼行數:24,代碼來源:ShapeFileDialog.java

示例9: testFindAll

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test
public void testFindAll()
{
    List<UserGroup> groups = userGroupDAO.findAll();
    assertTrue("No groups", groups.size() > 0);
    UserGroup group = groups.get(0);
    assertTrue("Empty group name", group.getName().length() > 0);


    Set<String> expected = new HashSet<>(Arrays.asList(new String[]{"adminGroup", "other", "otherGroup", "destination"}));
    Set<String> found = new HashSet<>();
    for (UserGroup g : groups) {
        LOGGER.debug("Found group " + g);
        found.add(g.getName());
    }
    assertEquals("Bad group set found", expected, found);
}
 
開發者ID:geoserver,項目名稱:geofence,代碼行數:18,代碼來源:UserGroupDAOLdapImplTest.java

示例10: TestCase

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public TestCase(String[] csvP) {
	boolean valid = false;
	if(csvP!=null) {
		List<String> csvParts = Arrays.asList(csvP);
		for (int i = 0; i < csvParts.size(); i++) {
			setProperties(csvParts, i);
		}
		valid = csvParts.size()>4;
	} else {
		valid = false;
	}
	if(!valid)
	{
		throw new RuntimeException("Invalid CSV data provided for creating TestCase");
	}
}
 
開發者ID:sumeetchhetri,項目名稱:gatf,代碼行數:18,代碼來源:TestCase.java

示例11: remove

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void remove(UUID[] uuids) {
	for (UUID uuid : uuids) {
		EhcacheHandler.getInstance().delete(EhcacheHandler.FOREVER_CACHE,uuid.getValue());
	}

	List<UUID> deleteTempalteList = Arrays.asList(uuids);

	List<Template> allTempaltes = getAll();
	Iterator<Template> it = allTempaltes.iterator();
	while (it.hasNext()) {
		if (deleteTempalteList.contains(it.next().getId())) {
			it.remove();
		}
	}

	setAll(allTempaltes);
}
 
開發者ID:afrous,項目名稱:Cynthia,代碼行數:19,代碼來源:TemplateCache.java

示例12: remove

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void remove(UUID[] uuids) {
	for (UUID uuid : uuids) {
		EhcacheHandler.getInstance().delete(EhcacheHandler.FOREVER_CACHE,uuid.getValue());
	}
	
	List<UUID> deleteTempalteList = Arrays.asList(uuids);
	
	List<TemplateType> allTemplateTypes = getAll();
	Iterator<TemplateType> it = allTemplateTypes.iterator();
	while (it.hasNext()) {
		if (deleteTempalteList.contains(it.next().getId())) {
			it.remove();
		}
	}
	
	setAll(allTemplateTypes);
}
 
開發者ID:afrous,項目名稱:Cynthia,代碼行數:19,代碼來源:TemplateTypeCache.java

示例13: allProjects

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private Set<Project> allProjects() {
	return new HashSet<>(Arrays.asList(new Project[] {
			project("spring-cloud-aws", "1.2.0.BUILD-SNAPSHOT"),
			project("spring-cloud-sleuth", "1.2.0.BUILD-SNAPSHOT")
	}));
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-release-tools,代碼行數:8,代碼來源:PropertyVersionChangerTests.java

示例14: testMarshaller

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test
public void testMarshaller() throws JAXBException, IOException, StoppedByUserException {

	InfoResources info = new InfoResources();
	ResourceInfo resource = new  ResourceInfo();

	resource.setMd5("12345");
	resource.setRelativePath("dir1/test.txt");

	@SuppressWarnings("unchecked")
   List<ResourceInfo> list = Arrays.asList(new ResourceInfo[] {resource});
  info.setList(list);

  File milestone = new File(rootDir, "unknown_translation_milestone.xml");
	MilestoneUtil.storeMilestoneFile(info, milestone);

    String expectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
	+"<resources>\n"
	+"    <info-resource>\n"
	+"        <md5>12345</md5>\n"
	+"        <relativePath>dir1/test.txt</relativePath>\n"
	+"    </info-resource>\n"
	+"</resources>\n";

    
   String actualResult = IOUtils.toString
      (new FileInputStream(milestone), "utf-8");
  
	Assert.assertEquals(expectedResult, actualResult);
}
 
開發者ID:oxygenxml,項目名稱:oxygen-dita-translation-package-builder,代碼行數:31,代碼來源:JaxbTest.java

示例15: testIntrospectPropertyForFibresReserved

import edu.emory.mathcs.backport.java.util.Arrays; //導入方法依賴的package包/類
@Test(expected = IllegalAccessException.class)
public void testIntrospectPropertyForFibresReserved()
        throws InvalidPropertyException, InvocationTargetException, IllegalAccessException {
    String logicalId = "/myfibre/myid";
    MyFibreType myFibreType = new MyFibreType();
    MyFibre myFibre = new MyFibre(logicalId, myFibreType);
    MyFibre[] myFibreArray = {myFibre};
    List<Fibre> fibres = Arrays.asList(myFibreArray);

    FibreIntrospectionUtils.introspectPropertyForFibres("memberOf", fibres, null);
}
 
開發者ID:HewlettPackard,項目名稱:loom,代碼行數:12,代碼來源:BaseModelTest.java


注:本文中的edu.emory.mathcs.backport.java.util.Arrays.asList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。