Examples of Implementation


Examples of com.android.tools.lint.detector.api.Implementation

        Set<Class<? extends Detector>> detectorClasses = new HashSet<Class<? extends Detector>>();
        Map<Class<? extends Detector>, EnumSet<Scope>> detectorToScope =
                new HashMap<Class<? extends Detector>, EnumSet<Scope>>();

        for (Issue issue : issues) {
            Implementation implementation = issue.getImplementation();
            Class<? extends Detector> detectorClass = implementation.getDetectorClass();
            EnumSet<Scope> issueScope = implementation.getScope();
            if (!detectorClasses.contains(detectorClass)) {
                // Determine if the issue is enabled
                if (!configuration.isEnabled(issue)) {
                    continue;
                }

                assert implementation.isAdequate(scope); // Ensured by getIssuesForScope above

                detectorClass = client.replaceDetector(detectorClass);

                assert detectorClass != null : issue.getId();
                detectorClasses.add(detectorClass);
View Full Code Here

Examples of com.cloud.api.Implementation

        // Create a new command, set name/description/usage
        Command apiCommand = new Command();
        apiCommand.setName(command);

        Implementation impl = clas.getAnnotation(Implementation.class);
        if (impl == null) {
            impl = clas.getSuperclass().getAnnotation(Implementation.class);
        }

        if (impl.includeInApiDoc()) {
            String commandDescription = impl.description();
            if (commandDescription != null && !commandDescription.isEmpty()) {
              apiCommand.setDescription(commandDescription);
            } else {
              System.out.println("Command " + apiCommand.getName() + " misses description");
            }

           
            String commandUsage = impl.usage();
            if (commandUsage != null && !commandUsage.isEmpty()) {
              apiCommand.setUsage(commandUsage);
            }
           
            //Set version when the API is added
            if(!impl.since().isEmpty()){
              apiCommand.setSinceVersion(impl.since());
            }
           
            // Set request parameters
            Field[] fields = clas.getDeclaredFields();

            // Get fields from superclass
            Class<?> superClass = clas.getSuperclass();
            boolean isAsync = false;
            while (superClass != null && superClass != Object.class) {
                String superName = superClass.getName();
                if (!superName.equals(BaseCmd.class.getName()) && !superName.equals(BaseAsyncCmd.class.getName()) && !superName.equals(BaseAsyncCreateCmd.class.getName())) {
                    Field[] superClassFields = superClass.getDeclaredFields();
                    if (superClassFields != null) {
                        Field[] tmpFields = new Field[fields.length + superClassFields.length];
                        System.arraycopy(fields, 0, tmpFields, 0, fields.length);
                        System.arraycopy(superClassFields, 0, tmpFields, fields.length, superClassFields.length);
                        fields = tmpFields;
                    }
                }
                superClass = superClass.getSuperclass();
                // Set Async information for the command
                if (superName.equals(BaseAsyncCmd.class.getName()) || superName.equals(BaseAsyncCreateCmd.class.getName())) {
                    isAsync = true;
                }
            }
          
            apiCommand.setAsync(isAsync);
           
            request = setRequestFields(fields);

            // Get response parameters
            Class<?> responseClas = impl.responseObject();
            Field[] responseFields = responseClas.getDeclaredFields();
            response = setResponseFields(responseFields, responseClas);

            apiCommand.setRequest(request);
            apiCommand.setResponse(response);
View Full Code Here

Examples of de.danet.an.workflow.api.Activity.Implementation

    public Implementation executor() {
   if (getPaExecStat().intValue() <= 0
       || getPaExecStat().intValue() == Integer.MAX_VALUE) {
       return null;
   }
   Implementation impl = getPaActImpl()[getPaExecStat().intValue() - 1];
        if (impl instanceof ProcBasedImpl) {
            ((ProcBasedImpl)impl).setProcessKey(getPaSubflow());
        }
        return impl;
    }
View Full Code Here

Examples of fr.imag.adele.apam.Implementation


    @Test
    public void CompositeDependencyFailException_tc045() {

  Implementation group_a = waitForImplByName(null,
    "group-a-fail-exception");

  Instance instance_a = group_a.createInstance(null, null);

  S3GroupAImpl ga1 = (S3GroupAImpl) instance_a.getServiceObject();

  String messageTemplate = "In dependency if we adopt fail='exception' exception='A', the exception A should be throw in case the dependency is not satifiable. %s";
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

        .getBundle(0)
        .getBundleContext()
        .getProperty(
          org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES));

  Implementation group_a = waitForImplByName(null,
    "group-a-fail-exception-native");

  Instance instance_a = group_a.createInstance(null, null);

  S3GroupAImpl ga1 = (S3GroupAImpl) instance_a.getServiceObject();

  String messageTemplate = "In dependency if we adopt fail='exception' exception='A' (With A being an exception that already exists in java JRE), the exception A should be throw in case the dependency is not satifiable. But the exception thrown was not type (A)";
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void CompositeDependencyFailWait_tc044() {

  Implementation cta = waitForImplByName(null, "group-a-fail-wait");

  Instance instanceApp1 = cta.createInstance(null, null);

  S3GroupAImpl ga1 = (S3GroupAImpl) instanceApp1.getServiceObject();

  ThreadWrapper wrapper = new ThreadWrapper(ga1);
  wrapper.setDaemon(true);
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void RelationConstraintForSourceInstanceTargetInstance_tc113() {

  Implementation implementation = waitForImplByName(null,
    "S07-DependencyImpl");

  Implementation implementationTarget = waitForImplByName(null,
    "S07-implementation-15");

  Instance instanceInvalid01 = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "do-not-take-this-instance");
        }
    });
  Instance instanceInvalid02 = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "neither-this");
        }
    });
  Instance instanceValid = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "the-chosen-one");
        }
    });
  Instance instanceInvalid04 = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "ignore-this");
        }
    });

  Instance instanceTarget = implementationTarget.createInstance(null,
    null);

  S07ImplementationImporter15 implem = (S07ImplementationImporter15) instanceTarget
    .getServiceObject();
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void RelationLinkCreationManual_tct004() {
  Implementation implementation = waitForImplByName(null,
    "S07-implementation-16");

  Instance instance = implementation.createInstance(null,
    Collections.<String, String> emptyMap());

  Implementation implementationdep = waitForImplByName(null,
    "S07-DependencyImpl-02");
  Instance instancedep = implementationdep.createInstance(null,
    Collections.<String, String> emptyMap());

  org.junit.Assert
    .assertTrue(
      "An exception should be raised as the dependency cannot be resolved automatically (creation=manual)",
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void RelationLinkResolveExist_tct001() {

  Implementation implementation = waitForImplByName(null,
    "S07-implementation-14");

  Instance instance = implementation.createInstance(null,
    Collections.<String, String> emptyMap());

  org.junit.Assert
    .assertTrue(
      "An exception should be raised as the dependency cannot be resolved as no instance running",
      testResolutionExceptionCase14(instance, 2));
  Assert.assertEquals(
    "No relations should have been created (no instance of dependency existing)",
    0, instance.getRawLinks().size());

  Implementation implementationdep = waitForImplByName(null,
    "S07-DependencyImpl-02");

  Instance instancedep = implementationdep.createInstance(null,
    Collections.<String, String> emptyMap());
  auxListInstances();

  org.junit.Assert
    .assertFalse(
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void RelationLinkResolveInternal_tct002() {
  Implementation implementation = waitForImplByName(null,
    "S07-implementation-14bis");

  Instance instance = implementation.createInstance(null,
    Collections.<String, String> emptyMap());

  org.junit.Assert
    .assertFalse(
      "No exception should be raised as the dependency should be instanciated",
      testResolutionExceptionCase14(instance, 2));
  Assert.assertEquals("One relation should have been created", 1,
    instance.getRawLinks().size());

  Instance instance2 = implementation.createInstance(null,
    Collections.<String, String> emptyMap());

  Implementation implementationdep = waitForImplByName(null,
    "S07-DependencyImpl-02");

  Assert.assertFalse(
    "No exception should be raised as the dependency is already instanciated",
    testResolutionExceptionCase14(instance2, 2));
  auxListInstances();
  Assert.assertEquals("Only one relation should have been created : ", 1,
    instance2.getRawLinks().size());
  Assert.assertEquals(
    "Only one instance of dependency should have been instanciated",
    1, implementationdep.getInsts().size());

  // Test should fail on external bundle resolution
  testResolutionExceptionCase14(instance2, 3);
  auxListInstances();
  org.junit.Assert
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.