Package org.apache.gora.examples.generated

Examples of org.apache.gora.examples.generated.Employee


  public void testCloneEmployee() throws Exception {
    @SuppressWarnings("unchecked")
    MemStore<String, Employee> store = DataStoreFactory.getDataStore(
        MemStore.class, String.class, Employee.class, conf);

    Employee employee = DataStoreTestUtil.createEmployee(store);
   
    testClone(employee);
  }
View Full Code Here


    testClone(employee);
  }
 
  @Test
  public void testCloneEmployeeOneField() throws Exception {
    Employee employee = new Employee();
    employee.setSsn(new Utf8("11111"));

    testClone(employee);
  }
View Full Code Here

    testClone(employee);
  }

  @Test
  public void testCloneEmployeeTwoFields() throws Exception {
    Employee employee = new Employee();
    employee.setSsn(new Utf8("11111"));
    employee.setSalary(100);

    testClone(employee);
  }
View Full Code Here

    WebPage page = new WebPage();
    for(int i=0; i<WebPage._ALL_FIELDS.length; i++) {
      int index = page.getFieldIndex(WebPage._ALL_FIELDS[i]);
      Assert.assertEquals(i, index);
    }
    Employee employee = new Employee();
    for(int i=0; i<Employee._ALL_FIELDS.length; i++) {
      int index = employee.getFieldIndex(Employee._ALL_FIELDS[i]);
      Assert.assertEquals(i, index);
    }
  }
View Full Code Here

    //test clear new object
    page = new WebPage();
    page.clear();
   
    //test primitive fields
    Employee employee = new Employee();
    employee.clear();
  }
View Full Code Here

    //more tests for clone are in TestPersistentDatumReader
    @SuppressWarnings("unchecked")
    MemStore<String, Employee> store = DataStoreFactory.getDataStore(
        MemStore.class, String.class, Employee.class, new Configuration());

    Employee employee = DataStoreTestUtil.createEmployee(store);
   
    Assert.assertEquals(employee, employee.clone());
  }
View Full Code Here

  public void testSerdeEmployee() throws Exception {

    MemStore<String, Employee> store = DataStoreFactory.getDataStore(
        MemStore.class, String.class, Employee.class, new Configuration());

    Employee employee = DataStoreTestUtil.createEmployee(store);

    TestIOUtils.testSerializeDeserialize(employee);
  }
View Full Code Here

    TestIOUtils.testSerializeDeserialize(employee);
  }

  @Test
  public void testSerdeEmployeeOneField() throws Exception {
    Employee employee = new Employee();
    employee.setSsn(new Utf8("11111"));

    TestIOUtils.testSerializeDeserialize(employee);
  }
View Full Code Here

    TestIOUtils.testSerializeDeserialize(employee);
  }

  @Test
  public void testSerdeEmployeeTwoFields() throws Exception {
    Employee employee = new Employee();
    employee.setSsn(new Utf8("11111"));
    employee.setSalary(100);

    TestIOUtils.testSerializeDeserialize(employee);
  }
View Full Code Here

      Utf8 name = new Utf8("john");
      long dateOfBirth = System.currentTimeMillis();
      int salary = 1337;
      Utf8 ssn = new Utf8(String.valueOf(RANDOM.nextLong()));
     
      Employee e = new Employee();
      e.setName(name);
      e.setDateOfBirth(dateOfBirth);
      e.setSalary(salary);
      e.setSsn(ssn);
     
      byte[] employerBytes = HBaseByteInterface.toBytes(e, Employee._SCHEMA);
      Employee e2 = (Employee) HBaseByteInterface.fromBytes(Employee._SCHEMA,
          employerBytes);
     
      Assert.assertEquals(name, e2.getName());
      Assert.assertEquals(dateOfBirth, e2.getDateOfBirth());
      Assert.assertEquals(salary, e2.getSalary());
      Assert.assertEquals(ssn, e2.getSsn());
     
     
      //metadata
      Utf8 key = new Utf8("theKey");
      Utf8 value = new Utf8("theValue " + RANDOM.nextLong());
View Full Code Here

TOP

Related Classes of org.apache.gora.examples.generated.Employee

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.