Search in sources :

Example 6 with Library

use of com.android.builder.model.level2.Library in project atlas by alibaba.

the class AtlasDependencyGraph method clone.

public static DependencyGraphs clone(@NonNull DependencyGraphs dependencyGraphs, int modelLevel, boolean modelWithFullDependency) {
    if (modelLevel < AndroidProject.MODEL_LEVEL_4_NEW_DEP_MODEL) {
        return EMPTY_DEPENDENCY_GRAPH;
    }
    Preconditions.checkState(dependencyGraphs instanceof ConfigurationDependencyGraphs);
    ConfigurationDependencyGraphs cdg = (ConfigurationDependencyGraphs) dependencyGraphs;
    // these items are already ready for serializable, all we need to clone is
    // the DependencyGraphs instance.
    List<Library> libs = cdg.getLibraries();
    synchronized (sGlobalLibrary) {
        for (Library library : libs) {
            sGlobalLibrary.put(library.getArtifactAddress(), library);
        }
    }
    final List<GraphItem> nodes = cdg.getCompileDependencies();
    if (modelWithFullDependency) {
        return new FullDependencyGraphsImpl(nodes, nodes, ImmutableList.of(), ImmutableList.of());
    }
    // just need to register the libraries in the global libraries.
    return new SimpleDependencyGraphsImpl(nodes, cdg.getProvidedLibraries());
}
Also used : ConfigurationDependencyGraphs(com.android.build.gradle.internal.dependency.ConfigurationDependencyGraphs) GraphItem(com.android.builder.model.level2.GraphItem) JvmLibrary(org.gradle.jvm.JvmLibrary) Library(com.android.builder.model.level2.Library)

Example 7 with Library

use of com.android.builder.model.level2.Library in project tesb-rt-se by Talend.

the class CorrelationFeatureTest method commonTest.

private void commonTest(String testName, String searchFor, String expectedResult) {
    LOG.setLevel(Level.FINE);
    final String dir = testName;
    serviceContext = startParticipants(dir);
    retrieveInterceptors(serviceContext);
    Library client = (Library) serviceContext.getBean("libraryHttp");
    try {
        searchFor(searchFor, client);
    } catch (SeekBookError e) {
        fail("Exception during service call");
    }
    // assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
    assertNotNull(providerInInterceptor.getLatestCorrelationHeader());
    assertTrue(providerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
// assertNotNull(consumerInInterceptor.getLatestCorrelationHeader());
// System.out.println("PROBLEM: " + consumerInInterceptor.getLatestCorrelationHeader());
// assertTrue(consumerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
}
Also used : SeekBookError(org.talend.services.test.library._1_0.SeekBookError) Library(org.talend.services.test.library._1_0.Library)

Example 8 with Library

use of com.android.builder.model.level2.Library in project tesb-rt-se by Talend.

the class CorrelationIdAssertionTest method commonTest.

private void commonTest(String testName, String searchFor, String expectedResult) {
    final String dir = testName;
    serviceContext = startParticipants(dir);
    retrieveInterceptors(serviceContext);
    Library client = (Library) serviceContext.getBean("libraryHttp");
    try {
        searchFor(searchFor, client);
    } catch (SeekBookError e) {
        fail("Exception during service call");
    }
    // assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
    assertNotNull(consumerOutInterceptor.getLatestCorrelationHeader());
    assertNotNull(providerInInterceptor.getLatestCorrelationHeader());
    assertTrue(providerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
    assertNotNull(consumerInInterceptor.getLatestCorrelationHeader());
    assertTrue(consumerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
    String providerInCorrelationId = providerInInterceptor.getLatestCorrelationHeader().toString();
    String consumerInCorrelationId = consumerInInterceptor.getLatestCorrelationHeader().toString();
    assertEquals(providerInCorrelationId, consumerInCorrelationId);
}
Also used : SeekBookError(org.talend.services.test.library._1_0.SeekBookError) Library(org.talend.services.test.library._1_0.Library)

Example 9 with Library

use of com.android.builder.model.level2.Library in project tesb-rt-se by Talend.

the class TransformationAssertionTest method commonTest.

private void commonTest(String testName, String searchFor, String expectedResult) {
    final String dir = testName;
    serviceContext = startParticipants(dir);
    Library client = (Library) serviceContext.getBean("libraryHttp");
    ListOfBooks response = null;
    try {
        response = searchFor(searchFor, client);
    } catch (SeekBookError e) {
        fail("Exception during service call");
    }
    assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
    assertEquals("Received unexpected author name", expectedResult, authorLastName(response));
}
Also used : SeekBookError(org.talend.services.test.library._1_0.SeekBookError) Library(org.talend.services.test.library._1_0.Library) ListOfBooks(org.talend.types.test.library.common._1.ListOfBooks)

Example 10 with Library

use of com.android.builder.model.level2.Library in project tesb-rt-se by Talend.

the class TransformationFeatureTest method commonTest.

private void commonTest(String testName, String searchFor, String expectedResult) {
    final String dir = testName;
    serviceContext = startProvider(dir);
    Library client = (Library) serviceContext.getBean("libraryHttp");
    ListOfBooks response = null;
    try {
        response = searchFor(searchFor, client);
    } catch (SeekBookError e) {
        fail("Exception during service call");
    }
    assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
    assertEquals("Received unexpected author name", expectedResult, authorLastName(response));
}
Also used : SeekBookError(org.talend.services.test.library._1_0.SeekBookError) Library(org.talend.services.test.library._1_0.Library) ListOfBooks(org.talend.types.test.library.common._1.ListOfBooks)

Aggregations

Library (org.talend.services.test.library._1_0.Library)8 SeekBookError (org.talend.services.test.library._1_0.SeekBookError)8 ListOfBooks (org.talend.types.test.library.common._1.ListOfBooks)6 Library (com.android.builder.model.level2.Library)2 JvmLibrary (org.gradle.jvm.JvmLibrary)2 NonNull (com.android.annotations.NonNull)1 ConfigurationDependencyGraphs (com.android.build.gradle.internal.dependency.ConfigurationDependencyGraphs)1 com.android.build.gradle.internal.ide.level2 (com.android.build.gradle.internal.ide.level2)1 JavaLibraryImpl (com.android.build.gradle.internal.ide.level2.JavaLibraryImpl)1 GraphItem (com.android.builder.model.level2.GraphItem)1 File (java.io.File)1 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)1 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)1