Search in sources :

Example 1 with SearchRecordType

use of com.netsuite.webservices.v2014_2.platform.core.types.SearchRecordType in project components by Talend.

the class NetSuiteClientServiceTest method testStandardMetaData.

@Test
public void testStandardMetaData() throws Exception {
    NetSuiteClientService<?> clientService = webServiceMockTestFixture.getClientService();
    Set<SearchRecordType> searchRecordTypeSet = new HashSet<>(Arrays.asList(SearchRecordType.values()));
    Set<String> searchRecordTypeNameSet = new HashSet<>();
    for (SearchRecordType searchRecordType : searchRecordTypeSet) {
        searchRecordTypeNameSet.add(toInitialUpper(searchRecordType.value()));
    }
    searchRecordTypeNameSet.add("InventoryDetail");
    searchRecordTypeNameSet.add("TimeEntry");
    for (String searchRecordType : searchRecordTypeNameSet) {
        try {
            SearchRecordTypeDesc searchRecordInfo = clientService.getMetaDataSource().getSearchRecordType(searchRecordType);
            assertNotNull("Search record def found: " + searchRecordType, searchRecordInfo);
        } catch (Exception e) {
            throw new AssertionError("Search record type: " + searchRecordType, e);
        }
    }
    Set<RecordType> recordTypeSet = new HashSet<>(Arrays.asList(RecordType.values()));
    Set<String> recordTypeNameSet = new HashSet<>();
    for (RecordType recordType : recordTypeSet) {
        recordTypeNameSet.add(toInitialUpper(recordType.value()));
    }
    recordTypeNameSet.add("InventoryDetail");
    recordTypeNameSet.add("TimeEntry");
    for (String recordType : recordTypeNameSet) {
        RecordTypeInfo recordTypeInfo = clientService.getMetaDataSource().getRecordType(recordType);
        assertNotNull("Record type def found: " + recordType, recordTypeInfo);
    }
}
Also used : SearchRecordTypeDesc(org.talend.components.netsuite.client.model.SearchRecordTypeDesc) SearchRecordType(com.netsuite.webservices.v2014_2.platform.core.types.SearchRecordType) RecordType(com.netsuite.webservices.v2014_2.platform.core.types.RecordType) RecordTypeInfo(org.talend.components.netsuite.client.model.RecordTypeInfo) SearchRecordType(com.netsuite.webservices.v2014_2.platform.core.types.SearchRecordType) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 2 with SearchRecordType

use of com.netsuite.webservices.v2014_2.platform.core.types.SearchRecordType in project components by Talend.

the class NetSuiteClientServiceTest method testBasicMetaData.

@Test
public void testBasicMetaData() throws Exception {
    NetSuiteClientService<?> clientService = webServiceMockTestFixture.getClientService();
    Set<SearchRecordType> searchRecordTypeSet = new HashSet<>(Arrays.asList(SearchRecordType.values()));
    Set<String> searchRecordTypeNameSet = new HashSet<>();
    for (SearchRecordType searchRecordType : searchRecordTypeSet) {
        searchRecordTypeNameSet.add(toInitialUpper(searchRecordType.value()));
    }
    searchRecordTypeNameSet.add("Address");
    searchRecordTypeNameSet.add("InventoryDetail");
    searchRecordTypeNameSet.add("TimeEntry");
    for (String searchRecordType : searchRecordTypeNameSet) {
        try {
            SearchRecordTypeDesc searchRecordInfo = clientService.getMetaDataSource().getSearchRecordType(searchRecordType);
            assertNotNull("Search record def found: " + searchRecordType, searchRecordInfo);
        } catch (Exception e) {
            throw new AssertionError("Search record type: " + searchRecordType, e);
        }
    }
    Set<RecordType> recordTypeSet = new HashSet<>(Arrays.asList(RecordType.values()));
    recordTypeSet.remove(RecordType.CUSTOM_TRANSACTION_TYPE);
    Set<String> recordTypeNameSet = new HashSet<>();
    for (RecordType recordType : recordTypeSet) {
        recordTypeNameSet.add(toInitialUpper(recordType.value()));
    }
    recordTypeNameSet.add("Address");
    recordTypeNameSet.add("InventoryDetail");
    recordTypeNameSet.add("TimeEntry");
    for (String recordType : recordTypeNameSet) {
        RecordTypeInfo recordTypeInfo = clientService.getMetaDataSource().getRecordType(recordType);
        assertNotNull("Record type def found: " + recordType, recordTypeInfo);
    }
    Collection<SearchFieldOperatorName> searchOperatorNames = clientService.getBasicMetaData().getSearchOperatorNames();
    List<SearchFieldOperatorName> searchFieldOperatorNameList = new ArrayList<>(searchOperatorNames);
    Collections.sort(searchFieldOperatorNameList, new Comparator<SearchFieldOperatorName>() {

        @Override
        public int compare(SearchFieldOperatorName o1, SearchFieldOperatorName o2) {
            return o1.getQualifiedName().compareTo(o2.getQualifiedName());
        }
    });
    for (SearchFieldOperatorName operatorName : searchFieldOperatorNameList) {
        assertNotNull(operatorName.getDataType());
        if (!SearchFieldOperatorType.BOOLEAN.dataTypeEquals(operatorName.getDataType())) {
            assertNotNull(operatorName.getName());
        }
    }
}
Also used : ArrayList(java.util.ArrayList) SearchRecordType(com.netsuite.webservices.v2016_2.platform.core.types.SearchRecordType) SearchFieldOperatorName(org.talend.components.netsuite.client.model.search.SearchFieldOperatorName) SearchRecordTypeDesc(org.talend.components.netsuite.client.model.SearchRecordTypeDesc) SearchRecordType(com.netsuite.webservices.v2016_2.platform.core.types.SearchRecordType) RecordType(com.netsuite.webservices.v2016_2.platform.core.types.RecordType) RecordTypeInfo(org.talend.components.netsuite.client.model.RecordTypeInfo) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)2 Test (org.junit.Test)2 RecordTypeInfo (org.talend.components.netsuite.client.model.RecordTypeInfo)2 SearchRecordTypeDesc (org.talend.components.netsuite.client.model.SearchRecordTypeDesc)2 RecordType (com.netsuite.webservices.v2014_2.platform.core.types.RecordType)1 SearchRecordType (com.netsuite.webservices.v2014_2.platform.core.types.SearchRecordType)1 RecordType (com.netsuite.webservices.v2016_2.platform.core.types.RecordType)1 SearchRecordType (com.netsuite.webservices.v2016_2.platform.core.types.SearchRecordType)1 ArrayList (java.util.ArrayList)1 SearchFieldOperatorName (org.talend.components.netsuite.client.model.search.SearchFieldOperatorName)1