Java Code Examples for org.aspectj.lang.Aspects#aspectOf()

The following examples show how to use org.aspectj.lang.Aspects#aspectOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultPersonServiceTests.java    From openregistry with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    this.personRepository = new MockPersonRepository(new MockPerson());
    this.objectFactory = new ObjectFactory<Person>() {
        public Person getObject() {
            return new MockPerson();
        }
    };


    this.personService = new DefaultPersonService(personRepository, new MockReferenceRepository(), new MockDisclosureRecalculationStrategyRepository(), new NoOpIdentifierGenerator(), new MockReconciler(ReconciliationType.NONE));
    this.personService.setIdCardGenerator(new MockIdCardGenerator());
    this.personService.setPersonObjectFactory(this.objectFactory);
    reconciliationCriteria = new MockReconciliationCriteria();
    setReconciliationCriteria(reconciliationCriteria);
    final SoRSpecificationThreadLocalAspect aspect = Aspects.aspectOf(SoRSpecificationThreadLocalAspect.class);
    aspect.setSystemOfRecordRepository(new MockSystemOfRecordRepository());    }
 
Example 2
Source File: AbstractIntegrationTests.java    From openregistry with Apache License 2.0 5 votes vote down vote up
@Before
  public void dataBaseSetUp() throws Exception {
      this.simpleJdbcTemplate.update("insert into prd_identifier_types(identifier_t, name, format, private, modifiable, notifiable, deleted, description) values(null, 'NETID', 'format', false, false, true, false, 'description')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types(id, data_type, description) values(1, 'NAME', 'FORMAL')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(2, 'TERMINATION', 'UNSPECIFIED')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(3, 'FOO', 'Foo Description')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(4, 'TERMINATION', 'FIRED')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(5, 'SPONSOR', 'PERSON')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(6, 'AFFILIATION', 'STAFF')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(7, 'AFFILIATION', 'STUDENT')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(8, 'AFFILIATION', 'FACULTY')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(9, 'ADDRESS', 'HOME')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(10, 'ADDRESS', 'OFFICE')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(11, 'PHONE', 'LANDLINE')");
      this.simpleJdbcTemplate.update("insert into ctx_data_types (id, data_type, description) values(12, 'PHONE', 'CELL')");
      this.simpleJdbcTemplate.update("insert into prd_campuses(id, code, name) values(1, 'cam', 'Busch')");
      this.simpleJdbcTemplate.update("insert into ctd_countries(id, code, name) values(1, 'US', 'USA')");
      this.simpleJdbcTemplate.update("insert into drd_organizational_units(id, campus_id, organizational_unit_t, code, name) values(1, 1, 3, 'cod', 'Department')");
      this.simpleJdbcTemplate.update("insert into drd_organizational_units(id, campus_id, organizational_unit_t, code, name) values(2, 1, 3, 'fish', 'Department')");
      this.simpleJdbcTemplate.update("insert into prd_system_of_record(id, sor_id) values(1, 'test')");

// create two more SoRs
      simpleJdbcTemplate.update("insert into prd_system_of_record(id, sor_id) values(1000, '"+SOR_ID1+"')");
      simpleJdbcTemplate.update("insert into prd_system_of_record(id, sor_id) values(2000, '"+SOR_ID2+"')");

      final SoRSpecificationThreadLocalAspect aspect = Aspects.aspectOf(SoRSpecificationThreadLocalAspect.class);
      aspect.setSystemOfRecordRepository(new MockSystemOfRecordRepository());

      System.out.println("Test:@@@@@@@@@@@@@@@@@@@@@@@@@@@");
  }
 
Example 3
Source File: PollableAspectConfig.java    From mojito with Apache License 2.0 4 votes vote down vote up
@Bean
public PollableAspect getPollableAspect() {
    return Aspects.aspectOf(PollableAspect.class);
}
 
Example 4
Source File: RunAsAspectConfig.java    From mojito with Apache License 2.0 4 votes vote down vote up
@Bean
RunAsAspect getRunAsAspect() {
    return Aspects.aspectOf(RunAsAspect.class);
}
 
Example 5
Source File: JsonRawStringAspectConfig.java    From mojito with Apache License 2.0 4 votes vote down vote up
@Bean
public JsonRawStringAspect getJsonRawStringAspect() {
    return Aspects.aspectOf(JsonRawStringAspect.class);
}
 
Example 6
Source File: AspectJConfig.java    From spring-aop-blog with MIT License 4 votes vote down vote up
/**
 * Makes the aspect a Spring bean, eligible for receiving autowired components.
 */
@Bean
public HystrixAspect hystrixAspect() {
    HystrixAspect aspect = Aspects.aspectOf(HystrixAspect.class);
    return aspect;
}
 
Example 7
Source File: AspectJBaseTest.java    From automon with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    MyAspectJTestAspect aspect = Aspects.aspectOf(MyAspectJTestAspect.class);
    aspect.setOpenMon(openMon);
}
 
Example 8
Source File: AutomonAnnotationsTest.java    From automon with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    MyAutomonTestAspect aspect = Aspects.aspectOf(MyAutomonTestAspect.class);
    aspect.setOpenMon(openMon);
}
 
Example 9
Source File: JamonAnnotationsTest.java    From automon with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    MyJamonTestAspect aspect = Aspects.aspectOf(MyJamonTestAspect.class);
    aspect.setOpenMon(openMon);
}
 
Example 10
Source File: MetricsAnnotationsTest.java    From automon with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    MyMetricsTestAspect aspect = Aspects.aspectOf(MyMetricsTestAspect.class);
    aspect.setOpenMon(openMon);
}
 
Example 11
Source File: JavaSimonAnnotationsTest.java    From automon with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
    MyJavaSimonTestAspect aspect = Aspects.aspectOf(MyJavaSimonTestAspect.class);
    aspect.setOpenMon(openMon);
}