Package org.apache.felix.ipojo.test.scenarios.configuration.service

Examples of org.apache.felix.ipojo.test.scenarios.configuration.service.FooService


    assertEquals("Check foo equality -2", fooP, "foo");
    assertEquals("Check bar equality -2", barP, new Integer(2));
    assertEquals("Check baz equality -2", bazP, "zab");

     // Get Service
        FooService fs = (FooService) context.getService(fooRef);
        Integer updated = (Integer) fs.fooProps().get("updated");

        assertEquals("Check updated", 1, updated.intValue());

    getContext().ungetService(msRef);
View Full Code Here


        assertEquals("Check foo equality -2", fooP, "foo");
        assertEquals("Check bar equality -2", barP, new Integer(2));
        assertEquals("Check baz equality -2", bazP, "zab");

        // Get Service
        FooService fs = (FooService) context.getService(fooRef);
        Integer updated = (Integer) fs.fooProps().get("updated");

        assertEquals("Check updated", 1, updated.intValue());

        getContext().ungetService(msRef);
    }
View Full Code Here

      assertEquals("Check foo equality", fooP, "oof");
      assertEquals("Check bar equality", barP, new Integer(0));
      assertEquals("Check baz equality", bazP, "zab");

      // Check field value
      FooService fs = (FooService) getContext().getService(fooRef);
      Properties p = fs.fooProps();
      fooP = (String) p.get("foo");
      barP = (Integer) p.get("bar");

      assertEquals("Check foo field equality", fooP, "oof");
      assertEquals("Check bar field equality", barP, new Integer(0));

        Integer updated = (Integer) fs.fooProps().get("updated");

        assertEquals("Check updated", 1, updated.intValue());

      getContext().ungetService(fooRef);
      getContext().ungetService(msRef);
View Full Code Here

        assertEquals("Check foo equality", fooP, "oof");
        assertEquals("Check bar equality", barP, new Integer(0));
        assertEquals("Check baz equality", bazP, "zab");

        // Check field value
        FooService fs = (FooService) getContext().getService(fooRef);
        Properties p = fs.fooProps();
        fooP = (String) p.get("foo");
        barP = (Integer) p.get("bar");

        assertEquals("Check foo field equality", fooP, "oof");
        assertEquals("Check bar field equality", barP, new Integer(0));

        Integer updated = (Integer) fs.fooProps().get("updated");

        assertEquals("Check updated", 1, updated.intValue());

        getContext().ungetService(fooRef);
        getContext().ungetService(msRef);
View Full Code Here

    assertEquals("Check foo equality", fooP, "oof");
    assertEquals("Check bar equality", barP, new Integer(0));
    assertEquals("Check baz equality", bazP, "zab");

    // Check field value
    FooService fs = (FooService) getContext().getService(fooRef);
    Properties p = fs.fooProps();
    fooP = (String) p.get("foo");
    barP = (Integer) p.get("bar");

    assertEquals("Check foo field equality", fooP, "oof");
    assertEquals("Check bar field equality", barP, new Integer(0));

    Integer updated = (Integer) fs.fooProps().get("updated");

        assertEquals("Check updated", 1, updated.intValue());

    getContext().ungetService(fooRef);
    getContext().ungetService(msRef);
View Full Code Here

  }

  public void testComponentTypeConfiguration() {
    ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider1.getInstanceName());
    assertNotNull("Check FooService availability", ref);
    FooService fs = (FooService) getContext().getService(ref);
    Properties toCheck = fs.fooProps();

    Integer intProp = (Integer) toCheck.get("intProp");
    Boolean boolProp = (Boolean) toCheck.get("boolProp");
    String strProp = (String) toCheck.get("strProp");
    String[] strAProp = (String[]) toCheck.get("strAProp");
    int[] intAProp = (int[]) toCheck.get("intAProp");

    // Check updated
    Integer updated = (Integer) toCheck.get("updated");
    Dictionary dict = (Dictionary) toCheck.get("lastupdated");

    assertEquals("Check intProp equality (1)", intProp, new Integer(2));
    assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
    assertEquals("Check strProp equality (1)", strProp, new String("foo"));
    assertNotNull("Check strAProp not nullity (1)", strAProp);
    String[] v = new String[] {"foo", "bar"};
    for (int i = 0; i < strAProp.length; i++) {
      if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1) : " + strAProp[i] + " != " + v[i]); }
    }
    assertNotNull("Check intAProp not nullity", intAProp);
    int[] v2 = new int[] {1, 2, 3};
    for (int i = 0; i < intAProp.length; i++) {
      if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1) : " + intAProp[i] + " != " + v2[i]); }
    }

    assertEquals("updated count ", 1, updated.intValue());
    assertEquals("Last updated", 5, dict.size());

    // change the field value
    assertTrue("Invoke the fs service", fs.foo());
    toCheck = fs.fooProps();


    //  Re-check the property (change)
    intProp = (Integer) toCheck.get("intProp");
    boolProp = (Boolean) toCheck.get("boolProp");
View Full Code Here

  public void testNoValue() {
        ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-3");
        assertNotNull("Check the availability of the FS service", sr);

        FooService fs = (FooService) getContext().getService(sr);
        Properties toCheck = fs.fooProps();

        // Check service properties
        Integer intProp = (Integer) toCheck.get("intProp");
        Boolean boolProp = (Boolean) toCheck.get("boolProp");
        String strProp = (String) toCheck.get("strProp");
        String[] strAProp = (String[]) toCheck.get("strAProp");
        int[] intAProp = (int[]) toCheck.get("intAProp");

        // Check updated
        Integer updated = (Integer) toCheck.get("updated");
        Dictionary dict = (Dictionary) toCheck.get("lastupdated");

        assertEquals("Check intProp equality", intProp, new Integer(0));
        assertEquals("Check longProp equality", boolProp, new Boolean(false));
        assertEquals("Check strProp equality", strProp, null);
        assertNull("Check strAProp nullity", strAProp);
        assertNull("Check intAProp  nullity", intAProp);

        assertEquals("updated count ", 1, updated.intValue());
        assertEquals("Last update", 0, dict.size());

        assertTrue("invoke fs", fs.foo());
        toCheck = fs.fooProps();

        // Re-check the property (change)
        intProp = (Integer) toCheck.get("intProp");
        boolProp = (Boolean) toCheck.get("boolProp");
        strProp = (String) toCheck.get("strProp");
View Full Code Here

  }
 
  public void testComponentTypeConfiguration() {
    ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider1.getInstanceName());
    assertNotNull("Check FooService availability", ref);
    FooService fs = (FooService) getContext().getService(ref);
    Properties toCheck = fs.fooProps();
   
    Integer intProp = (Integer) toCheck.get("intProp");
    Boolean boolProp = (Boolean) toCheck.get("boolProp");
    String strProp = (String) toCheck.get("strProp");
    String[] strAProp = (String[]) toCheck.get("strAProp");
    int[] intAProp = (int[]) toCheck.get("intAProp");
   
    assertEquals("Check intProp equality (1)", intProp, new Integer(2));
    assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
    assertEquals("Check strProp equality (1)", strProp, new String("foo"));
    assertNotNull("Check strAProp not nullity (1)", strAProp);
    String[] v = new String[] {"foo", "bar"};
    for (int i = 0; i < strAProp.length; i++) {
      if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1) : " + strAProp[i] + " != " + v[i]); }
    }
    assertNotNull("Check intAProp not nullity", intAProp);
    int[] v2 = new int[] {1, 2, 3};
    for (int i = 0; i < intAProp.length; i++) {
      if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1) : " + intAProp[i] + " != " + v2[i]); }
    }
   
    // change the field value
    assertTrue("Invoke the fs service", fs.foo());
    toCheck = fs.fooProps();
   
   
    //  Re-check the property (change)
    intProp = (Integer) toCheck.get("intProp");
    boolProp = (Boolean) toCheck.get("boolProp");
View Full Code Here

 
  public void testInstanceConfiguration() {
    ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-2");
    assertNotNull("Check the availability of the FS service", sr);
   
    FooService fs = (FooService) getContext().getService(sr);
    Properties toCheck = fs.fooProps();
   
    // Check service properties
    Integer intProp = (Integer) toCheck.get("intProp");
    Boolean boolProp = (Boolean) toCheck.get("boolProp");
    String strProp = (String) toCheck.get("strProp");
    String[] strAProp = (String[]) toCheck.get("strAProp");
    int[] intAProp = (int[]) toCheck.get("intAProp");
   
    assertEquals("Check intProp equality", intProp, new Integer(4));
    assertEquals("Check longProp equality", boolProp, new Boolean(false));
    assertEquals("Check strProp equality", strProp, new String("bar"));
    assertNotNull("Check strAProp not nullity", strAProp);
    String[] v = new String[] {"bar", "foo"};
    for (int i = 0; i < strAProp.length; i++) {
      if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
    }
    assertNotNull("Check intAProp not nullity", intAProp);
    int[] v2 = new int[] {1, 2, 3};
    for (int i = 0; i < intAProp.length; i++) {
      if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
    }
   
   
    assertTrue("invoke fs", fs.foo());
    toCheck = fs.fooProps();
   
    // Re-check the property (change)
    intProp = (Integer) toCheck.get("intProp");
    boolProp = (Boolean) toCheck.get("boolProp");
    strProp = (String) toCheck.get("strProp");
View Full Code Here

 
  public void testNoValue() {
        ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-3");
        assertNotNull("Check the availability of the FS service", sr);
       
        FooService fs = (FooService) getContext().getService(sr);
        Properties toCheck = fs.fooProps();
       
        // Check service properties
        Integer intProp = (Integer) toCheck.get("intProp");
        Boolean boolProp = (Boolean) toCheck.get("boolProp");
        String strProp = (String) toCheck.get("strProp");
        String[] strAProp = (String[]) toCheck.get("strAProp");
        int[] intAProp = (int[]) toCheck.get("intAProp");
       
        assertEquals("Check intProp equality", intProp, new Integer(0));
        assertEquals("Check longProp equality", boolProp, new Boolean(false));
        assertEquals("Check strProp equality", strProp, null);
        assertNull("Check strAProp nullity", strAProp);
        assertNull("Check intAProp  nullity", intAProp);
      
        assertTrue("invoke fs", fs.foo());
        toCheck = fs.fooProps();
       
        // Re-check the property (change)
        intProp = (Integer) toCheck.get("intProp");
        boolProp = (Boolean) toCheck.get("boolProp");
        strProp = (String) toCheck.get("strProp");
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.test.scenarios.configuration.service.FooService

Copyright © 2018 www.massapicom. 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.